Skip to content

Commit

Permalink
Recovering .encoding syntax for compatilitity in case someone directl…
Browse files Browse the repository at this point in the history
…y uses it
  • Loading branch information
henryiii committed Dec 27, 2016
1 parent 70243c3 commit e525b88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions plumbum/machines/base.py
Expand Up @@ -61,6 +61,14 @@ def __contains__(self, cmd):
return False
else:
return True

@property
def encoding(self):
'This is a wrapper for custom_encoding'
return self.custom_encoding
@encoding.setter
def encoding(self, value):
self.custom_encoding = value

def daemonic_popen(self, command, cwd = "/", stdout=None, stderr=None, append=True):
raise NotImplementedError("This is not implemented on this machine!")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_local.py
Expand Up @@ -392,7 +392,7 @@ def test_popen(self):
p = ls.popen(["-a"])
out, _ = p.communicate()
assert p.returncode == 0
assert "test_local.py" in out.decode(local.custom_encoding).splitlines()
assert "test_local.py" in out.decode(local.encoding).splitlines()

def test_run(self):
from plumbum.cmd import ls, grep
Expand Down

0 comments on commit e525b88

Please sign in to comment.