Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

3.12: tokenize adds a newline when it is not there #105259

Closed
Assignees
lysnikolaou
Labels
3.12only security fixes3.13bugs and security fixesrelease-blockertype-bugAn unexpected behavior, bug, or error
@asottile

Description

@asottile

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

cc@pablogsal

Linked PRs

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixesrelease-blockertype-bugAn unexpected behavior, bug, or error

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp