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,17 +281,18 @@ class FileList(_FileList): ...@@ -281,17 +281,18 @@ 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':
# NTFS can store UTF-8 filenames as is
if os.path.exists(path.encode('utf-8')):
self.files.append(path)
except UnicodeEncodeError: except UnicodeEncodeError:
log.warn("%r not %s encodable -- skipping", path, # Support UTF-8 filenames even if LANG=C
sys.getfilesystemencoding()) if os.path.exists(path.encode('utf-8')):
self.files.append(path)
else:
log.warn("%r not %s encodable -- skipping", path,
sys.getfilesystemencoding())
else: else:
if os.path.exists(path): if os.path.exists(path):
self.files.append(path) self.files.append(path)
......
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