[Python-Dev] 3.2.1 encoding surprise

Terry Reedy tjreedy at udel.edu
Mon Jul 18 21:40:39 CEST 2011


On 7/18/2011 3:10 PM, Glenn Linderman wrote:
> Attached reduced test case works fine with Python 3.1, fails with Python3.2:
>
> SyntaxError: Non-ASCII character '\xc3' in file D:\my\py\t32enc.py on
> line 1, but no encoding declared; see
> http://www.python.org/peps/pep-0263.html for details

It runs fine for me on winxp, 3.2.1, both command prompt and idle.
When cut/paste worked, I downloaded file and ran that.

> I'm familiar with the PEP, but thought 3.x cured that.  Python 3.1
> produces no error; I'm not sure that 3.2 did or didn't report such
> problems, or if the programs I ran with 3.2 simply didn't contain
> non-ASCII characters.
>
> The file is UTF-8 encoded with no pseudo-BOM.
>
> Is this intentional, or a regression (in which case I will open a ticket)?
>
> If a regression, does that mean we have no tests for it, possibly
> because most of the tests contain the PEP 263 encoding directive,
> because most people using 3.x are still also using 2.x (I am not)?

Or there could be a test (have not checked) which usually passes.


-- 
Terry Jan Reedy



More information about the Python-Dev mailing list