[New-bugs-announce] [issue9632] Remove sys.setfilesystemencoding()

STINNER Victor report at bugs.python.org
Wed Aug 18 13:56:04 CEST 2010

New submission from STINNER Victor <victor.stinner at haypocalc.com>:

sys.setfilesystemencoding() function is dangerous because it introduces a lot of inconsistencies: this function is unable to reencode all filenames in all objects (eg. Python is unable to find filenames in user objects or 3rd party libraries). Eg. if you change the filesystem from utf8 to ascii, it will not be possible to use existing non-ascii (unicode) filenames: they will raise UnicodeEncodeError.

As sys.setdefaultencoding() in Python2, I think that sys.setfilesystemencoding() is the root of evil :-) PYTHONFSENCODING (issue #8622) is the right solution to set the filesysteme encoding.

Attached patch removes sys.setfilesystemencoding().

components: Library (Lib), Unicode
messages: 114211
nosy: haypo
priority: normal
severity: normal
status: open
title: Remove sys.setfilesystemencoding()
versions: Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list