diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-08-17 13:57:39 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-08-17 13:57:39 (GMT) |
commit | d9e9528818ca54831a64a624a59b4e9d74d2ef4e (patch) | |
tree | 91d4e98d95d8677cc021f17ddf2dabb789fcab05 | |
parent | 87bbf257ef6e8d1e5876776094db609702ee468a (diff) | |
download | cpython-d9e9528818ca54831a64a624a59b4e9d74d2ef4e.zip cpython-d9e9528818ca54831a64a624a59b4e9d74d2ef4e.tar.gz cpython-d9e9528818ca54831a64a624a59b4e9d74d2ef4e.tar.bz2 |
Issue #22165: Fixed test_undecodable_filename on Mac OS.
-rw-r--r-- | Lib/test/test_httpservers.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index ad058b5..f164054 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -277,6 +277,13 @@ class SimpleHTTPServerTestCase(BaseTestCase): with open(os.path.join(self.tempdir, filename), 'wb') as f: f.write(support.TESTFN_UNDECODABLE) response = self.request(self.tempdir_name + '/') + if sys.platform == 'darwin': + # On Mac OS the HFS+ filesystem replaces bytes that aren't valid + # UTF-8 into a percent-encoded value. + for name in os.listdir(self.tempdir): + if name != 'test': # Ignore a filename created in setUp(). + filename = name + break body = self.check_status_and_reason(response, 200) quotedname = urllib.parse.quote(filename, errors='surrogatepass') self.assertIn(('href="%s"' % quotedname) |