From e525b88111158031c576c9223c5a680e838459c3 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Tue, 27 Dec 2016 16:00:50 -0500 Subject: [PATCH] Recovering .encoding syntax for compatilitity in case someone directly uses it --- plumbum/machines/base.py | 8 ++++++++ tests/test_local.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plumbum/machines/base.py b/plumbum/machines/base.py index a934d01f..300f201e 100644 --- a/plumbum/machines/base.py +++ b/plumbum/machines/base.py @@ -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!") diff --git a/tests/test_local.py b/tests/test_local.py index 436fe590..0b89379d 100644 --- a/tests/test_local.py +++ b/tests/test_local.py @@ -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