[Python-ideas] TextIOWrapper callable encoding parameter

Eric Snow ericsnowcurrently at gmail.com
Mon Jun 11 17:11:50 CEST 2012

On Mon, Jun 11, 2012 at 8:42 AM, Rurpy <rurpy at yahoo.com> wrote:
> Here is another issue that came up in my ongoing
> adventure porting to Python3...
> Executive summary:
> ==================
> There is no good way to read a text file when the
> encoding has to be determined by reading the start
> of the file.  A long-winded version of that follows.
> Scroll down the the "Proposal" section to skip it.

FWIW, the import system does an encoding check on Python source files
that is somewhat related.  See


More information about the Python-ideas mailing list