This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: run runtktests.py error when test tkinter
Type: behavior Stage: resolved
Components: Tkinter Versions: Python 3.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: allensll, eric.snow, iritkatriel, martin.panter, ncoghlan, serhiy.storchaka
Priority: normal Keywords:

Created on 2016-01-27 13:36 by allensll, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg259021 - (view) Author: (allensll) Date: 2016-01-27 13:36
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.
msg259243 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-01-30 07:56
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.
msg259250 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-01-30 11:03
According to Issue 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?
msg408352 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-12 00:18
runtktests.py was deleted here: https://github.com/python/cpython/pull/28929
History
Date User Action Args
2022-04-11 14:58:26adminsetgithub: 70404
2021-12-12 00:18:24iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg408352

resolution: out of date
stage: resolved
2020-11-04 21:35:52brett.cannonsetnosy: - brett.cannon
2016-01-30 11:03:30martin.pantersetnosy: + martin.panter
messages: + msg259250
2016-01-30 07:56:39serhiy.storchakasetnosy: + brett.cannon, ncoghlan, eric.snow
messages: + msg259243
2016-01-30 02:05:20terry.reedysetnosy: + serhiy.storchaka
2016-01-27 13:36:20allensllcreate