What is file.encoding convention?
gagsl-py2 at yahoo.com.ar
Tue Jul 28 08:45:52 CEST 2009
En Thu, 23 Jul 2009 21:49:26 -0300, Naoki INADA <songofacandy at gmail.com>
>>> The encoding that this file uses. When Unicode strings are written to
>>> a file,
>>> they will be converted to byte strings using this encoding. In
>>> when the file is connected to a terminal, the attribute gives the
>>> that the terminal is likely to use
> I feel this doc means "file object with encoding attribute encodes
> regardless it is tty or not" and sys.stdout/stderr defies convention.
The 'encoding' file attribute is very confusing and mostly unsupported (or
there is a bug in the documentation, at least in Python 2.x). See
More information about the Python-list