diff options
author | Stefan H. Holek <stefan@epy.co.at> | 2012-11-10 22:14:57 +0100 |
---|---|---|
committer | Stefan H. Holek <stefan@epy.co.at> | 2012-11-10 22:14:57 +0100 |
commit | be8173d7f6e5e971c5f028d5049d932cf5043efb (patch) | |
tree | 9a80fda9dd0b5fa0f61b6a24ba796db1d435cbe6 /setuptools/command/egg_info.py | |
parent | 91379d9c17d2ac432f64e1952e2b3d47c83eedcc (diff) | |
download | external_python_setuptools-be8173d7f6e5e971c5f028d5049d932cf5043efb.tar.gz external_python_setuptools-be8173d7f6e5e971c5f028d5049d932cf5043efb.tar.bz2 external_python_setuptools-be8173d7f6e5e971c5f028d5049d932cf5043efb.zip |
Accept UTF-8 filenames into the filelist even if LANG=C.
--HG--
branch : distribute
extra : rebase_source : 499443a97846396e5790d80af32050f57f4aa43d
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-x | setuptools/command/egg_info.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index d37ba900..085a499b 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -281,17 +281,18 @@ class FileList(_FileList): if item.endswith('\r'): # Fix older sdists built on Windows item = item[:-1] path = convert_path(item) + if sys.version_info >= (3,): try: - if os.path.exists(path): + if os.path.exists(path) or os.path.exists(path.encode('utf-8')): self.files.append(path) - elif sys.platform == 'win32': - # NTFS can store UTF-8 filenames as is - if os.path.exists(path.encode('utf-8')): - self.files.append(path) except UnicodeEncodeError: - log.warn("%r not %s encodable -- skipping", path, - sys.getfilesystemencoding()) + # Support UTF-8 filenames even if LANG=C + if os.path.exists(path.encode('utf-8')): + self.files.append(path) + else: + log.warn("%r not %s encodable -- skipping", path, + sys.getfilesystemencoding()) else: if os.path.exists(path): self.files.append(path) |