Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run runtktests.py error when test tkinter #70404

Closed
allensll mannequin opened this issue Jan 27, 2016 · 4 comments
Closed

run runtktests.py error when test tkinter #70404

allensll mannequin opened this issue Jan 27, 2016 · 4 comments
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@allensll
Copy link
Mannequin

allensll mannequin commented Jan 27, 2016

BPO 26216
Nosy @ncoghlan, @ericsnowcurrently, @vadmium, @serhiy-storchaka, @iritkatriel

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-12-12.00:18:24.088>
created_at = <Date 2016-01-27.13:36:20.114>
labels = ['type-bug', 'expert-tkinter']
title = 'run runtktests.py error when test tkinter'
updated_at = <Date 2021-12-12.00:18:24.086>
user = 'https://bugs.python.org/allensll'

bugs.python.org fields:

activity = <Date 2021-12-12.00:18:24.086>
actor = 'iritkatriel'
assignee = 'none'
closed = True
closed_date = <Date 2021-12-12.00:18:24.088>
closer = 'iritkatriel'
components = ['Tkinter']
creation = <Date 2016-01-27.13:36:20.114>
creator = 'allensll'
dependencies = []
files = []
hgrepos = []
issue_num = 26216
keywords = []
message_count = 4.0
messages = ['259021', '259243', '259250', '408352']
nosy_count = 6.0
nosy_names = ['ncoghlan', 'eric.snow', 'martin.panter', 'serhiy.storchaka', 'allensll', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue26216'
versions = ['Python 3.5']

@allensll
Copy link
Mannequin Author

allensll mannequin commented Jan 27, 2016

When I run the following:
python ...\Python35\Lib\tkinter\test\runtktests.py
Error:
SystemError: Parent module 'tkinter.test' not loaded, cannot perform relative import
When I add "import tkinter.test" into runtktests.py,it's working.

@allensll allensll mannequin added topic-tkinter type-bug An unexpected behavior, bug, or error labels Jan 27, 2016
@serhiy-storchaka
Copy link
Member

This is rather import machinery issue. The simple reproducer:

$ ./python -c "import importlib; importlib.import_module('.bar', 'foo')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 981, in _gcd_import
  File "<frozen importlib._bootstrap>", line 931, in _sanity_check
SystemError: Parent module 'foo' not loaded, cannot perform relative import

SystemError means programming error and shouldn't be triggered by user code.

@vadmium
Copy link
Member

vadmium commented Jan 30, 2016

According to bpo-18018, the SystemError is changed to ImportError in 3.6, and in Python 2 (or before 3.3) it raised ValueError.

To me, the more important question is: is running runtktests.py as a file meant to be supported, or should it be run as python -m tkinter.test.runtktests?

@iritkatriel
Copy link
Member

runtktests.py was deleted here: #28929

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants