Commit be8173d7 authored by Stefan H. Holek's avatar Stefan H. Holek

Accept UTF-8 filenames into the filelist even if LANG=C.

--HG--
branch : distribute
extra : rebase_source : 499443a97846396e5790d80af32050f57f4aa43d
parent 91379d9c
...@@ -281,15 +281,16 @@ class FileList(_FileList): ...@@ -281,15 +281,16 @@ class FileList(_FileList):
if item.endswith('\r'): # Fix older sdists built on Windows if item.endswith('\r'): # Fix older sdists built on Windows
item = item[:-1] item = item[:-1]
path = convert_path(item) path = convert_path(item)
if sys.version_info >= (3,): if sys.version_info >= (3,):
try: try:
if os.path.exists(path): if os.path.exists(path) or os.path.exists(path.encode('utf-8')):
self.files.append(path) self.files.append(path)
elif sys.platform == 'win32': except UnicodeEncodeError:
# NTFS can store UTF-8 filenames as is # Support UTF-8 filenames even if LANG=C
if os.path.exists(path.encode('utf-8')): if os.path.exists(path.encode('utf-8')):
self.files.append(path) self.files.append(path)
except UnicodeEncodeError: else:
log.warn("%r not %s encodable -- skipping", path, log.warn("%r not %s encodable -- skipping", path,
sys.getfilesystemencoding()) sys.getfilesystemencoding())
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment