Senthil Kumaran added the comment:

Looks like we hit with an encoding issue, which is due to way os.fsdecode() and 
os.listdir() decode the filenames.


>>> support.TESTFN_UNDECODABLE
b'@test_99678_tmp\xe7w\xf0'
>>> dir_list = os.listdir(self.tempdir)
>>> dir_list
['@test_99678_tmp%E7w%F0.txt', 'test']
>>> filename = os.fsdecode(support.TESTFN_UNDECODABLE) + '.txt'
>>> filename
'@test_99678_tmp\udce7w\udcf0.txt'


======================================================================
FAIL: test_undecodable_filename (test.test_httpservers.SimpleHTTPServerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Lib/test/test_httpservers.py",
 line 282, in test_undecodable_filename
    .encode('utf-8', 'surrogateescape'), body)
AssertionError: b'href="%40test_62069_tmp%ED%B3%A7w%ED%B3%B0.txt"' not found in 
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>\n<html>\n<head>\n<meta 
http-equiv="Content-Type" content="text/html; charset=utf-8">\n<title>Directory 
listing for tmp0asrs9ei/</title>\n</head>\n<body>\n<h1>Directory listing for 
tmp0asrs9ei/</h1>\n<hr>\n<ul>\n<li><a 
href="%40test_62069_tmp%25E7w%25F0.txt">@test_62069_tmp%E7w%F0.txt</a></li>\n<li><a
 href="test">test</a></li>\n</ul>\n<hr>\n</body>\n</html>\n'

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to