[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2018-04-22 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +6272 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2012-07-07 Thread Florent Xicluna
Florent Xicluna added the comment: Thanks. Fixed in trunk too, changeset b4322ad1fec4 -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker __

[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2012-07-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5020afc0b7c9 by Florent Xicluna in branch '3.2': Issue #14990: tokenize: correctly fail with SyntaxError on invalid encoding declaration. http://hg.python.org/cpython/rev/5020afc0b7c9 -- nosy: +python-dev _

[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2012-06-06 Thread STINNER Victor
STINNER Victor added the comment: Oops, I didn't want to attach my patch to the issue. Mine is wrong, whereas yours is the right fix :-) -- ___ Python tracker ___ _

[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2012-06-06 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file25825/detect_encoding.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2012-06-06 Thread Florent Xicluna
Florent Xicluna added the comment: It should raise a SyntaxError, if coding is 'utf8'. I don't agree with the last patch proposed. If the import report a SyntaxError, 'tokenize' should do the same. $ ./python Lib/test/bad_coding2.py File "Lib/test/bad_coding2.py", line 1 SyntaxError: encodin

[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2012-06-04 Thread STINNER Victor
STINNER Victor 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

[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2012-06-03 Thread Florent Xicluna
Florent Xicluna added the comment: This patch seems to fix the issue. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file25805/issue14990_detect_encoding.diff ___ Python tracker

[issue14990] detect_encoding should fail with SyntaxError on invalid encoding

2012-06-03 Thread Florent Xicluna
New submission from Florent Xicluna : I've hit this issue while playing with tokenize for the pep8.py module. The tokenize detect_encoding() should report SyntaxError when the encoding is improperly declared. However it raises a LookupError in some cases. $ ./python -m tokenize Lib/test/bad_c