[issue27797] ASCII file with UNIX line conventions and enough lines throws SyntaxError when ASCII-compatible codec is declared

2019-03-29 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> SyntaxError: encoding problem: iso-8859-1 on Windows ___ Python tracker _

[issue27797] ASCII file with UNIX line conventions and enough lines throws SyntaxError when ASCII-compatible codec is declared

2016-08-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue27797] ASCII file with UNIX line conventions and enough lines throws SyntaxError when ASCII-compatible codec is declared

2016-08-19 Thread Eryk Sun
Eryk Sun added the comment: In issue 20844 I suggested opening the file in binary mode, i.e. change the call to _Py_wfopen(filename, L"rb") in Modules/main.c. That would also entail documenting that PyRun_SimpleFileExFlags requires a FILE pointer that's opened in binary mode. After making this

[issue27797] ASCII file with UNIX line conventions and enough lines throws SyntaxError when ASCII-compatible codec is declared

2016-08-19 Thread SilentGhost
Changes by SilentGhost : -- stage: -> needs patch type: -> behavior versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-li

[issue27797] ASCII file with UNIX line conventions and enough lines throws SyntaxError when ASCII-compatible codec is declared

2016-08-19 Thread Martijn Pieters
New submission from Martijn Pieters: To reproduce, create an ASCII file with > io.DEFAULT_BUFFER_SIZE bytes (can be blank lines) and *UNIX line endings*, with the first two lines reading: #!/usr/bin/env python # -*- coding: cp1252 -*- Try to run this as a script on Windows: C:\Python3