summaryrefslogtreecommitdiff
path: root/setuptools/unicode_utils.py
diff options
context:
space:
mode:
authorSteve Kowalik <steven@wedontsleep.org>2016-02-16 16:01:54 +1100
committerSteve Kowalik <steven@wedontsleep.org>2016-02-16 16:01:54 +1100
commit69175b941a74a4e2f37b856437b3ca20bc2f240a (patch)
treee0349b731b724c76963f9fd429f53b22cbf142d3 /setuptools/unicode_utils.py
parent43d0308ad6a8c83be645b09e8c1871b36ff3c4c9 (diff)
parent8ccd428cd2a733891bffce13e017774ea82bd8d2 (diff)
downloadpython-setuptools-git-69175b941a74a4e2f37b856437b3ca20bc2f240a.tar.gz
Merge from master, resolving conflicts.
Diffstat (limited to 'setuptools/unicode_utils.py')
-rw-r--r--setuptools/unicode_utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/unicode_utils.py b/setuptools/unicode_utils.py
index 18903d9e..ffab3e24 100644
--- a/setuptools/unicode_utils.py
+++ b/setuptools/unicode_utils.py
@@ -22,11 +22,13 @@ def filesys_decode(path):
NONE when no expected encoding works
"""
- fs_enc = sys.getfilesystemencoding()
if isinstance(path, six.text_type):
return path
- for enc in (fs_enc, "utf-8"):
+ fs_enc = sys.getfilesystemencoding() or 'utf-8'
+ candidates = fs_enc, 'utf-8'
+
+ for enc in candidates:
try:
return path.decode(enc)
except UnicodeDecodeError: