diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-01-22 15:59:17 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-01-22 15:59:17 +0100 |
commit | 70733eb799fc5b7bca949be55096508d948cb5ad (patch) | |
tree | 80303dab754c64208afdbe0b4166489a00de34a5 | |
parent | 818ef90fdcfc6749786ba9ff38a1314910d92ca2 (diff) | |
parent | c88ae94f9665f68d22bdf854c9052907d004d5b1 (diff) | |
download | psutil-70733eb799fc5b7bca949be55096508d948cb5ad.tar.gz |
Merge branch 'master' of github.com:giampaolo/psutil
-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, |