summaryrefslogtreecommitdiff
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-xsetuptools/command/egg_info.py14
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):