summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-02-20 22:34:21 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-02-20 22:34:21 (GMT)
commit9e9af21d45e8f5c9debd799fd521a87b0d97c698 (patch)
tree1f08df7914d1f2d817c2c7916537d4dda5465eda /Lib/test/test_support.py
parent18d5a6966980387051e5c1012d9a87a46eda3d34 (diff)
downloadcpython-9e9af21d45e8f5c9debd799fd521a87b0d97c698.zip
cpython-9e9af21d45e8f5c9debd799fd521a87b0d97c698.tar.gz
cpython-9e9af21d45e8f5c9debd799fd521a87b0d97c698.tar.bz2
skip tests with a non-ascii cwd when the file system encoding is ascii
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 0732cce..db57533 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -397,6 +397,13 @@ def temp_cwd(name='tempcwd', quiet=False):
the CWD, an error is raised. If it's True, only a warning is raised
and the original CWD is used.
"""
+ if isinstance(name, unicode):
+ try:
+ name = name.encode(sys.getfilesystemencoding() or 'ascii')
+ except UnicodeEncodeError:
+ if not quiet:
+ raise unittest.SkipTest('unable to encode the cwd name with '
+ 'the filesystem encoding.')
saved_dir = os.getcwd()
is_temporary = False
try: