diff options
author | Stefan H. Holek <stefan@epy.co.at> | 2012-10-26 12:46:41 +0200 |
---|---|---|
committer | Stefan H. Holek <stefan@epy.co.at> | 2012-10-26 12:46:41 +0200 |
commit | e485c19015d4fced68b25c09ca66a1743d3ab27c (patch) | |
tree | 1191fc24861c35b32cfbc8fecf896a5a5ee06734 /setuptools/tests/test_sdist.py | |
parent | f8481f4b522f0fbeafbb36a20dd105497f2623ac (diff) | |
download | external_python_setuptools-e485c19015d4fced68b25c09ca66a1743d3ab27c.tar.gz external_python_setuptools-e485c19015d4fced68b25c09ca66a1743d3ab27c.tar.bz2 external_python_setuptools-e485c19015d4fced68b25c09ca66a1743d3ab27c.zip |
Keep 'surrogateescape' when reading the manifest, to avoid breaking on bad input.
--HG--
branch : distribute
extra : rebase_source : 6f894cd508e73fae0ad02860654df5181055ba4d
Diffstat (limited to 'setuptools/tests/test_sdist.py')
-rw-r--r-- | setuptools/tests/test_sdist.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index 378015a8..04b3db66 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -262,7 +262,7 @@ class TestSdistTest(unittest.TestCase): # Python 3 only if sys.version_info >= (3,): - def test_read_manifest_rejects_surrogates(self): + def test_manifest_is_read_with_surrogateescape_error_handler(self): # Test for #303. # This is hard to test on HFS Plus because it quotes unknown @@ -286,11 +286,14 @@ class TestSdistTest(unittest.TestCase): manifest = open(cmd.manifest, 'ab') manifest.write(filename+b('\n')) manifest.close() + # Re-read manifest + try: + cmd.read_manifest() + except UnicodeDecodeError, e: + self.fail(e) finally: unquiet() - self.assertRaises(UnicodeDecodeError, cmd.read_manifest) - def test_sdist_with_utf8_encoded_filename(self): # Test for #303. dist = Distribution(SETUP_ATTRS) |