Message299935
I've just been bitten by this on 3.6.2, Windows Server 2008 R2, when running the setup.py script for QuantLib-SWIG:
https://github.com/lballabio/QuantLib-SWIG/blob/v1.10.x/Python/setup.py
It seems there is different behaviour depending on whether:
* Unix (LF) or Windows (CRLF) line endings are used
* The file is >4096 bytes or <=4096 bytes
* The module docstring has an initial space
Some of that has been mentioned previously, but I think the 4096-byte limit might be new, which is why I'm posting.
I've attached a script I used to come up with the results below. It contains:
* a -*- coding line (for iso-8859-1 in this case)
* a docstring consisting entirely of lines of x's, of length 78
* Unix line endings
The file's length is exactly 4096 bytes.
Running this, or slightly modified versions of this, with a 3.6.2 interpreter gave the following results:
* In all cases, when Windows line endings were used there was no issue - running the script produced no errors or output.
* With Unix line endings:
* File length <= 4096, with no leading spaces in the docstring:
File "issue20844.py", line 1
SyntaxError: encoding problem: iso-8859-1
* File length > 4096, with no leading spaces in the docstring:
File "issue20844.py", line 56
xxxxx"""
^
SyntaxError: EOF while scanning triple-quoted string literal
* Any file length, with the first 'x' on line 3 replaced with a space (line 2 if the coding line is ignored):
File "issue20844.py", line 2
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
^
IndentationError: unexpected indent
I had no issues with python 2.7.13. |
|
Date |
User |
Action |
Args |
2017-08-08 16:06:58 | steven.winfield | set | recipients:
+ steven.winfield, vstinner, nedbat, tim.golden, benjamin.peterson, miwa, BreamoreBoy, schlamar, zach.ware, eryksun |
2017-08-08 16:06:58 | steven.winfield | set | messageid: <1502208418.45.0.773715915442.issue20844@psf.upfronthosting.co.za> |
2017-08-08 16:06:58 | steven.winfield | link | issue20844 messages |
2017-08-08 16:06:57 | steven.winfield | create | |
|