diff -r 7cdc941d5180 Lib/test/test_httpservers.py --- a/Lib/test/test_httpservers.py Sun Aug 17 12:21:06 2014 +0300 +++ b/Lib/test/test_httpservers.py Sun Aug 17 13:13:18 2014 +0300 @@ -277,6 +277,12 @@ 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 os.listdir() uses different representation of + # undecodable filename than os.fsdecode(). + for filename in os.listdir(self.tempdir): + if filename != 'test': + break body = self.check_status_and_reason(response, 200) quotedname = urllib.parse.quote(filename, errors='surrogatepass') self.assertIn(('href="%s"' % quotedname)