Workaround issue #8611 in test_undecodable_code() of test_sys

Write test.support.workaroundIssue8611() function so it will be easier to
remove this workaround from all tests.
This commit is contained in:
Victor Stinner 2010-08-20 16:52:14 +00:00
parent 1b6372a1d1
commit c44abb127b
3 changed files with 36 additions and 31 deletions

View file

@ -1277,3 +1277,11 @@ def strip_python_stderr(stderr):
"""
stderr = re.sub(br"\[\d+ refs\]\r?\n?$", b"", stderr).strip()
return stderr
def workaroundIssue8611():
try:
sys.executable.encode('ascii')
except UnicodeEncodeError:
raise unittest.SkipTest(
"Issue #8611: Python doesn't support ascii locale encoding "
"with an non-ascii path")