Skip to content

tokenize.py emits spurious NEWLINE if file ends on a comment without a newline #88833

@MatthieuDartiailh

Description

@MatthieuDartiailh
BPO 44667
Nosy @terryjreedy, @ambv, @MatthieuDartiailh, @pablogsal, @miss-islington
PRs
  • bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer #27499
  • [3.10] bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer (GH-27499) #27500
  • [3.9] bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer (GH-27499) #27501
  • Files
  • no_newline_at_end_of_file_with_comment.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-07-31.01:17:51.161>
    created_at = <Date 2021-07-18.13:50:13.546>
    labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
    title = 'tokenize.py emits spurious NEWLINE if file ends on a comment without a newline'
    updated_at = <Date 2022-01-19.20:53:27.027>
    user = 'https://github.com/MatthieuDartiailh'

    bugs.python.org fields:

    activity = <Date 2022-01-19.20:53:27.027>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-07-31.01:17:51.161>
    closer = 'pablogsal'
    components = ['Library (Lib)']
    creation = <Date 2021-07-18.13:50:13.546>
    creator = 'mdartiailh'
    dependencies = []
    files = ['50157']
    hgrepos = []
    issue_num = 44667
    keywords = ['patch']
    message_count = 5.0
    messages = ['397750', '398615', '398738', '398739', '410980']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'lukasz.langa', 'mdartiailh', 'pablogsal', 'miss-islington']
    pr_nums = ['27499', '27500', '27501']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue44667'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10only security fixes3.11only security fixes3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions