Page MenuHomePhabricator

pwb error not found but exact match
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue / What happens?:

$ ./pwb version
ERROR: version.py not found! Misspelling?
WARNING: /data/project/dyk-tools/www/python/venv/lib/python3/7/site-packages/pywikibot/scripts does not exists; remove it from user_script_paths
NOTE: Starting the most similar script version.py
      in 5.0 seconds; type CTRL-C to stop.
Pywikibot: pywikibot/__init__.py (, -1 (unknown), 2022/10/11, 01:26:58, UNKNOWN)
Release version: 7.7.1
setuptools version: 40.8.0
mwparserfromhell version: 0.6.4
wikitextparser version: n/a
requests version: 2.28.1
  cacerts: /data/project/dyk-tools/www/python/venv/lib/python3.7/site-packages/certifi/cacert.pem
2022-10-11 08:37:54     roy649      certificate test: ok
Python: 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0]
PYWIKIBOT_DIR: Not set
PYWIKIBOT_DIR_PWB: /data/project/dyk-tools/www/python/venv/lib/python3.7/site-packages/pywikibot/scripts
PYWIKIBOT_NO_USER_CONFIG: Not set
Config base dir: /mnt/nfs/labstore-secondary-tools-project/dyk-tools/www/python/venv/bin

What should have happened instead?:

There shouldn't have been an error or delay since an exact match was found.

Software version:
See above

Event Timeline

The warning also looks incorrect.

Oh my, look at the warning message:

WARNING: /data/project/dyk-tools/www/python/venv/lib/python3/7/site-packages/pywikibot/scripts does not exists; remove it from user_script_paths

It should be "python3.7", not "python3/7"

just for fun, I patched my venv with a symlink:

ls -l venv/lib/python3
total 0
lrwxrwxrwx 1 tools.dyk-tools tools.dyk-tools 13 Oct 11 15:58 7 -> ../python3.7/

and that fixes it (FSVO "fixes"):

venv/bin/pwb version
Pywikibot: pywikibot/__init__.py (, -1 (unknown), 2022/10/11, 01:26:58, UNKNOWN)
Release version: 7.7.1
setuptools version: 40.8.0
mwparserfromhell version: 0.6.4
wikitextparser version: n/a
requests version: 2.28.1
  cacerts: /data/project/dyk-tools/www/python/venv/lib/python3.7/site-packages/certifi/cacert.pem
    certificate test: ok
Python: 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0]
PYWIKIBOT_DIR: Not set
PYWIKIBOT_DIR_PWB: /data/project/dyk-tools/www/python/venv/lib/python3.7/site-packages/pywikibot/scripts
PYWIKIBOT_NO_USER_CONFIG: Not set
Config base dir: /mnt/nfs/labstore-secondary-tools-project/dyk-tools/www/python

what is associated with ./pwb? The pwb.py script or the pwb.exe code entry point which will be installed with the site-package?

@Xqt I don't understand your question.

Based on the path, it is the entry point (not exe since it is linux).

Xqt triaged this task as High priority.EditedOct 12 2022, 12:02 PM

Got it: The _pwb root of the site_package is shown in PYWIKIBOT_DIR_PWB. Unfortunately pwb.find_filename.test_path() splits the path at the '.' sign here. Thats ok for the (user_)?script_paths but not for the root.

Xqt changed the task status from Open to In Progress.Oct 12 2022, 12:17 PM
Xqt claimed this task.

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

[pywikibot/core@master] [BUGFIX] Fix disolving script_paths for site-package

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

I fixed the script_path for site-package. You can create and install a local site-package by

make_dist -local -upgrade

To cleanup distribution files after installation you may use

make_dist -nodist -clean

https://doc.wikimedia.org/pywikibot/stable/utilities/install.html#module-make_dist

I have taken myself off the gerrit review list, as I'm not familiar enough with the code base to give useful input on this change.

Change 841902 merged by jenkins-bot:

[pywikibot/core@master] [BUGFIX] Fix disolving script_paths for site-package

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