-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding marker may only appear on the first two lines per PEP263 #529
Comments
I'm not sure what wrong behavior in coverage.py you are reporting. What happens? I have a test for this case, so I'm not sure what you are seeing, or whether my test is wrong: https://bitbucket.org/ned/coveragepy/src/eb9f4a94096cca9863352f600994340caf4f6927/tests/test_phystokens.py?fileviewer=file-view-default#test_phystokens.py-131 |
Original comment by Maurice Pud (Bitbucket: moepud, GitHub: moepud) I think this is easiest to illustrate with some test cases.
|
I can see that neuter_encoding_declaration is changing more declarations than it needs to. But is there an actual product-level problem? What source files is coverage.py treating incorrectly? I'd like to understand the whole problem. |
Original comment by Maurice Pud (Bitbucket: moepud, GitHub: moepud) Here's a simple test file that passes when run normally but fails when running under coverage. The reason it fails is that the
|
Perfect, thanks for the detail. Fixed in 54e15c3a7e85 (bb). |
This fix was released as part of Coverage.py 4.3. |
Originally reported by gpshead (Bitbucket: gpshead, GitHub: gpshead)
The file text encoding marker must only be paid attention to if it falls on the first two lines of the file.
(confirmed by testing that a coding marker in a comment on line 3 is ignored in CPython 2.7 and 3.4)
The bug appears to be in https://bitbucket.org/ned/coveragepy/src/eb9f4a94096cca9863352f600994340caf4f6927/coverage/phystokens.py?at=default&fileviewer=file-view-default#phystokens.py-291 phystokens.neuter_encoding_declaration which neuters the first two encoding declarations seen in a file instead of only within the first two lines.
The text was updated successfully, but these errors were encountered: