Content-Length: 302400 | pFad | https://github.com/python/cpython/issues/101400

ad Negative line number in stacktrace exception · Issue #101400 · python/cpython · GitHub
Skip to content

Negative line number in stacktrace exception #101400

Description

@Kartatz

The following code snippet generates a stacktrace exception pointing to a invalid line number (-1):

with object() as obj:
	break

Example:

$ echo 'with object() as obj:\n\tbreak' > main.py
$ python main.py
  File "/home/kartz/main.py", line -1
SyntaxError: 'break' outside loop

This is reproducible with Python 3.10, 3.11 and latest master. I could not reproduce this on Python versions older than <3.10.

Linked PRs

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/issues/101400

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy