diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-01-22 04:37:50 -0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-01-22 04:37:50 -0800 |
commit | c88ae94f9665f68d22bdf854c9052907d004d5b1 (patch) | |
tree | 2ff11845d0cf50186842413e668c4103570a0829 | |
parent | ba838832f03365587191b2e1849278d3eb414ee1 (diff) | |
download | psutil-c88ae94f9665f68d22bdf854c9052907d004d5b1.tar.gz |
fix windows/py3.3 failure
-rw-r--r-- | test/test_psutil.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/test_psutil.py b/test/test_psutil.py index f7888261..84bccd6b 100644 --- a/test/test_psutil.py +++ b/test/test_psutil.py @@ -3284,7 +3284,11 @@ class TestNonUnicode(unittest.TestCase): def test_proc_exe(self): funny_executable = os.path.join(self.temp_directory, b"\xc0\x80") - shutil.copy(self.test_executable, funny_executable) + # This is broken on py 3.3, hence the manual copy + # shutil.copy(self.test_executable, funny_executable) + with open(self.test_executable, 'rb') as input: + with open(funny_executable, 'wb') as output: + output.write(input.read()) self.addCleanup(safe_remove, funny_executable) subp = get_test_subprocess(cmd=[decode_path(funny_executable)], stdin=subprocess.PIPE, @@ -3298,7 +3302,11 @@ class TestNonUnicode(unittest.TestCase): def test_proc_name(self): funny_executable = os.path.join(self.temp_directory, b"\xc0\x80") - shutil.copy(self.test_executable, funny_executable) + # This is broken on py 3.3, hence the manual copy + # shutil.copy(self.test_executable, funny_executable) + with open(self.test_executable, 'rb') as input: + with open(funny_executable, 'wb') as output: + output.write(input.read()) self.addCleanup(safe_remove, funny_executable) subp = get_test_subprocess(cmd=[decode_path(funny_executable)], stdin=subprocess.PIPE, |