Antoine Pitrou <pit...@free.fr> added the comment: It is more complicated than that. The algorithm is currently as follows (copied from TextIOWrapper.__init__):
if encoding is None: try: encoding = os.device_encoding(buffer.fileno()) except (AttributeError, UnsupportedOperation): pass if encoding is None: try: import locale except ImportError: # Importing locale may fail if Python is being built encoding = "ascii" else: encoding = locale.getpreferredencoding() ---------- nosy: +pitrou _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5107> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com