Skip to content

SyntaxError.offset sometimes wrong #46111

Closed

Description

@achimgaedke
BPO 1778
Nosy @akuchling, @devdanzin, @benjaminp
Files
  • compile_test.py: Example Program
  • compile_test.py: more compiler exceptions with line offset missing
  • 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 2016-11-06.20:42:49.311>
    created_at = <Date 2008-01-09.23:19:44.713>
    labels = ['interpreter-core', 'type-bug']
    title = 'SyntaxError.offset sometimes wrong'
    updated_at = <Date 2016-11-06.20:42:49.309>
    user = 'https://bugs.python.org/AchimGaedke'

    bugs.python.org fields:

    activity = <Date 2016-11-06.20:42:49.309>
    actor = 'akuchling'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-11-06.20:42:49.311>
    closer = 'akuchling'
    components = ['Interpreter Core']
    creation = <Date 2008-01-09.23:19:44.713>
    creator = 'AchimGaedke'
    dependencies = []
    files = ['9116', '9150']
    hgrepos = []
    issue_num = 1778
    keywords = []
    message_count = 6.0
    messages = ['59634', '59865', '87909', '116861', '117022', '280170']
    nosy_count = 4.0
    nosy_names = ['akuchling', 'ajaksu2', 'AchimGaedke', 'benjamin.peterson']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'needs patch'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1778'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    Activity

    1. achimgaedke commented on Jan 9, 2008

      achimgaedkemannequin
      MannequinAuthor

      The value SyntaxError.offset is for most SyntaxErrors an offset from
      beginning of line SyntaxError.lineno. In case of an triple-quoted string
      which is not at all closed, offset seems to be the offset from beginning
      of the buffer.

    2. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-bugAn unexpected behavior, bug, or error
      on Jan 9, 2008
    3. achimgaedke commented on Jan 13, 2008

      achimgaedkemannequin
      MannequinAuthor

      sometimes offset is None...

      Example:
      def blub(bla, blub=None, blabla):
      bla

      causes:
      non-default argument follows default argument

    4. devdanzin commented on May 16, 2009

      devdanzinmannequin
      Mannequin

      Confirmed in trunk and py3k.

    5. BreamoreBoy commented on Sep 19, 2010

      BreamoreBoymannequin
      Mannequin

      This will go nowhere until someone supplies a patch. I'm assuming unit tests can be built using the attached test file.

    6. benjaminp commented on Sep 21, 2010

      @benjaminp
      Contributor

      None offsets gone in r84931.

    7. akuchling commented on Nov 6, 2016

      @akuchling
      Contributor

      Fixed in Python 3.2 alpha 3, so there's no longer any work to be done for this issue. Closing.

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions