Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
Closed
Description
Bug report
tokenize adds a concrete newline character when it is not present. this breaks any sort of roundtrip source generation and pycodestyle's end-of-file checker
here's an example of a file containing a single byte (generated viaecho -n 1 > t.py
)
#hd -c t.py00000000 31 |1|0000000 10000001#python3.12 -m tokenize t.py0,0-0,0: ENCODING 'utf-8'1,0-1,1: NUMBER '1'1,1-1,2: NEWLINE '\n'2,0-2,0: ENDMARKER ''#python3.11 -m tokenize t.py0,0-0,0: ENCODING 'utf-8'1,0-1,1: NUMBER '1'1,1-1,2: NEWLINE ''2,0-2,0: ENDMARKER ''
Your environment
- CPython versions tested on: 3.12dbd7d7c
- Operating system and architecture: ubuntu 22.04 LTS x86_64
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done