diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-16 23:46:43 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-16 23:46:43 (GMT) |
commit | f6782ac0b69d1bfaa7f629357db757a021ddede1 (patch) | |
tree | c67dbc48523a91f6e591dff649f007573f7a1426 /Lib/test/test_subprocess.py | |
parent | 61aad57dc9df19c2e073779e0ab389b949960801 (diff) | |
download | cpython-f6782ac0b69d1bfaa7f629357db757a021ddede1.zip cpython-f6782ac0b69d1bfaa7f629357db757a021ddede1.tar.gz cpython-f6782ac0b69d1bfaa7f629357db757a021ddede1.tar.bz2 |
test_subprocess: use surrogateescape error handler to write shell scripts
test_args_string() and test_call_string() create shell scripts including the
path to the Python executable: use surrogateescape to encode paths including
surrogate characters.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index c21de19..a08a8aa 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -752,7 +752,7 @@ class POSIXProcessTestCase(BaseTestCase): # args is a string fd, fname = mkstemp() # reopen in text mode - with open(fd, "w") as fobj: + with open(fd, "w", errors="surrogateescape") as fobj: fobj.write("#!/bin/sh\n") fobj.write("exec '%s' -c 'import sys; sys.exit(47)'\n" % sys.executable) @@ -795,7 +795,7 @@ class POSIXProcessTestCase(BaseTestCase): # call() function with string argument on UNIX fd, fname = mkstemp() # reopen in text mode - with open(fd, "w") as fobj: + with open(fd, "w", errors="surrogateescape") as fobj: fobj.write("#!/bin/sh\n") fobj.write("exec '%s' -c 'import sys; sys.exit(47)'\n" % sys.executable) |