diff options
author | Stefan H. Holek <stefan@epy.co.at> | 2012-10-08 19:48:19 +0200 |
---|---|---|
committer | Stefan H. Holek <stefan@epy.co.at> | 2012-10-08 19:48:19 +0200 |
commit | 6851d4e38e1e4e5a2bbbf2556523fd19675cdbf7 (patch) | |
tree | a9b9c43b92f7d844d9f6334aa1426c32b0c4c8ae /setuptools/command/egg_info.py | |
parent | 077a69aef0973333cafe4c7548dceb5418d1c36f (diff) | |
download | external_python_setuptools-6851d4e38e1e4e5a2bbbf2556523fd19675cdbf7.tar.gz external_python_setuptools-6851d4e38e1e4e5a2bbbf2556523fd19675cdbf7.tar.bz2 external_python_setuptools-6851d4e38e1e4e5a2bbbf2556523fd19675cdbf7.zip |
Make sure the manifest never contains decomposed UTF-8.
--HG--
branch : distribute
extra : rebase_source : 0e0fb3beac56f66f12670ec69ebfd3996d12d912
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-x | setuptools/command/egg_info.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 46cdf4e0..e932d46a 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -287,6 +287,19 @@ class FileList(FileList): +def compose(path): + # Apple's HFS Plus returns decomposed UTF-8. Since just about + # everyone else chokes on it, we must make sure to return fully + # composed UTF-8 only. + if sys.getfilesystemencoding().lower() == 'utf-8': + from unicodedata import normalize + if sys.version_info >= (3,): + path = normalize('NFC', path) + else: + path = normalize('NFC', path.decode('utf-8')).encode('utf-8') + return path + + class manifest_maker(sdist): template = "MANIFEST.in" @@ -311,6 +324,7 @@ class manifest_maker(sdist): self.prune_file_list() self.filelist.sort() self.filelist.remove_duplicates() + self.filelist.files = [compose(path) for path in self.filelist.files] self.write_manifest() def write_manifest (self): |