# error: TypeError: run\_command() got an unexpected keyword argument 'encoding'

**URL:** <https://forum.ansible.com/t/error-typeerror-run-command-got-an-unexpected-keyword-argument-encoding/22935>\
**Category:** Ansible Project\
**Created:** [November 1, 2016, 9:46pm UTC](https://forum.ansible.com/t/error-typeerror-run-command-got-an-unexpected-keyword-argument-encoding/22935 "2016-11-01T21:46:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric.anderson](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@eric.anderson](https://forum.ansible.com/u/eric.anderson)\
**Post date:** [November 1, 2016, 9:46pm UTC](https://forum.ansible.com/t/error-typeerror-run-command-got-an-unexpected-keyword-argument-encoding/22935/1 "2016-11-01T21:46:43Z")

</div>

I’m using ansible 2.2.0.0 and running in to a problem every time I use “sh”. I’ve run this same playbook against a vm on virtualbox on my local machine, but the user had very broad permissions. Now I’m trying to run against a remote server where the user has very limited permissions, so misleading message and a permissions problem is my best guess so far, but I can’t figure out what specific permission might be needed.

After keeping the temp files on the remote server, when I run $ python command.py there I get the following error:

Traceback (most recent call last):  
File “/tmp/ansible\_VG8VKH/ansible\_module\_command.py”, line 212, in   
main()  
File “/tmp/ansible\_VG8VKH/ansible\_module\_command.py”, line 189, in main  
rc, out, err = module.run\_command(args, executable=executable, use\_unsafe\_shell=shell, encoding=None)  
TypeError: run\_command() got an unexpected keyword argument ‘encoding’

I’m not able to find the /tmp files at all after the command.py executes, so I haven’t been able to look there to see what might be going on…

Eric
