mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #9425: skip tests if a filename is not encodable
This commit is contained in:
parent
87c9d6cf9c
commit
6c6f851eae
6 changed files with 29 additions and 4 deletions
|
@ -597,6 +597,10 @@ class OpenerDirectorTests(unittest.TestCase):
|
|||
|
||||
|
||||
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:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue