[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

STINNER Victor report at bugs.python.org
Tue Jun 5 01:06:02 CEST 2012


STINNER Victor <victor.stinner at gmail.com> added the comment:

The patch is correct according to the PEP 263:

    If a source file uses both the UTF-8 BOM mark signature and a
    magic encoding comment, the only allowed encoding for the comment
    is 'utf-8'.  Any other encoding will cause an error.

The fix should also be applied to 3.2.

(Note: Python 3.1 doesn't accept bugfixes anymore.)

----------
components: +Unicode
nosy: +ezio.melotti, haypo
versions:  -Python 3.1
Added file: http://bugs.python.org/file25825/detect_encoding.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14990>
_______________________________________


More information about the Python-bugs-list mailing list