Page MenuHomePhabricator

some scripts from site-package pywikibot-scripts fails when importing from scripts
Closed, ResolvedPublicBUG REPORT

Description

D:\>pwb reflinks -help
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\pwb.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\pywikibot\scripts\wrapper.py", line 539, in run
    if not execute():
           ^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pywikibot\scripts\wrapper.py", line 515, in execute
    run_python_file(filename, script_args, module)
  File "C:\Python311\Lib\site-packages\pywikibot\scripts\wrapper.py", line 152, in run_python_file
    exec(compile(source, filename, 'exec', dont_inherit=True),
  File "C:\Python311\Lib\site-packages\pywikibot_scripts\reflinks.py", line 75, in <module>
    from scripts import noreferences
ModuleNotFoundError: No module named 'scripts'
CRITICAL: Exiting due to uncaught exception ModuleNotFoundError: No module named 'scripts'

Event Timeline

Xqt changed the task status from Open to In Progress.Oct 12 2024, 8:48 AM
Xqt triaged this task as High priority.
Xqt changed the subtype of this task from "Task" to "Bug Report".

Change #1079586 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [bugfix] import scripts from pywikibot-scripts if site-package is isntalled

https://gerrit.wikimedia.org/r/1079586

Change #1079586 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] import scripts from pywikibot-scripts if site-package is installed

https://gerrit.wikimedia.org/r/1079586