commit | 6c6f851eae204c3a4f85108c3d564133d58c887a | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Sat Aug 07 10:09:35 2010 +0000 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Sat Aug 07 10:09:35 2010 +0000 |
tree | 555d578c77274ff79bf957d7f87dbd9a67c857f3 | |
parent | 87c9d6cf9cbf2cada6a309cf4e46d77c3484b4c2 [diff] [blame] |
Issue #9425: skip tests if a filename is not encodable
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 4d117c7..b2f7ea8 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py
@@ -597,6 +597,10 @@ def sanepathname2url(path): + try: + path.encode("utf8") + except UnicodeEncodeError: + raise unittest.SkipTest("path is not encodable to utf8") urlpath = urllib.request.pathname2url(path) if os.name == "nt" and urlpath.startswith("///"): urlpath = urlpath[2:]