Skip to content

Commit 34ac49d

Browse files
committed
Ensure fs encoding is always normalized #688
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent ee13af0 commit 34ac49d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/commoncode/fileutils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def logger_debug(*args):
7777
return logger.debug(' '.join(isinstance(a, basestring) and a or repr(a) for a in args))
7878

7979

80-
FS_ENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding()
80+
FS_ENCODING = sys.getfilesystemencoding()
81+
# normalize the encoding name
82+
FS_ENCODING = codecs.lookup(FS_ENCODING).name
8183

8284
# Paths can only be sanely handled as raw bytes on Linux
8385
PATH_TYPE = bytes if on_linux else unicode

0 commit comments

Comments
 (0)