Skip to content

'import traceback' Causes a Crash #90482

Closed

Description

@bichanna
mannequin
BPO 46324
Nosy @ronaldoussoren, @ned-deily, @stevendaprano, @kumaraditya303, @bichanna

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 2022-01-10.07:16:24.789>
created_at = <Date 2022-01-10.05:35:37.032>
labels = ['OS-mac', 'type-bug', 'invalid', '3.9']
title = "'import traceback' Causes a Crash"
updated_at = <Date 2022-01-10.07:16:24.786>
user = 'https://github.com/bichanna'

bugs.python.org fields:

activity = <Date 2022-01-10.07:16:24.786>
actor = 'steven.daprano'
assignee = 'none'
closed = True
closed_date = <Date 2022-01-10.07:16:24.789>
closer = 'steven.daprano'
components = ['macOS']
creation = <Date 2022-01-10.05:35:37.032>
creator = 'bichanna'
dependencies = []
files = []
hgrepos = []
issue_num = 46324
keywords = []
message_count = 3.0
messages = ['410187', '410189', '410191']
nosy_count = 5.0
nosy_names = ['ronaldoussoren', 'ned.deily', 'steven.daprano', 'kumaraditya', 'bichanna']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue46324'
versions = ['Python 3.9']

Activity

  1. bichanna commented on Jan 10, 2022

    bichannamannequin
    MannequinAuthor

    I was developing a programming language using Python, and I had a 'token.py' file. After changing the name of the file, the issue was solved.

    I am sure that my 'token.py' caused the error.

    Here's the traceback I got:
    Traceback (most recent call last):
      File "/some/path/main.py", line 2, in <module>
        from parser import Parser
      File "/some/path/parser.py", line 3, in <module>
        import traceback
      File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/traceback.py", line 5, in <module>
        import linecache
      File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/linecache.py", line 11, in <module>
        import tokenize
      File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tokenize.py", line 35, in <module>
        from token import EXACT_TOKEN_TYPES
    ImportError: cannot import name 'EXACT_TOKEN_TYPES' from 'token' (/some/path/token.py)
  2. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Jan 10, 2022
  3. kumaraditya303 commented on Jan 10, 2022

    @kumaraditya303
    Contributor

    Python has a token module so you should use any other name for your module.

  4. stevendaprano commented on Jan 10, 2022

    @stevendaprano
    Member

    Your module token.py "shadowed" the stdlib token.py, and prevented it from being seen until you changed the name.

  5. added
    type-bugAn unexpected behavior, bug, or error
    and removed
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Jan 10, 2022
  6. added
    type-bugAn unexpected behavior, bug, or error
    and removed
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Jan 10, 2022
  7. 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

    3.9 (EOL)end of lifeOS-mactype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions