Page MenuHomePhabricator

pywikibot configuration does not work
Closed, ResolvedPublic


I followed the steps in :wikitech:Help:Toolforge/Pywikibot#Using_the_shared_Pywikibot_files_(recommended_setup).

But when I run
tools.tool@tools-login$ python /data/project/shared/pywikibot/core/
I get

tools.svgworkaroundbot@tools-sgebastion-07:~$ python /data/project/shared/pywikibot/core/
Traceback (most recent call last):
  File "/data/project/shared/pywikibot/core/", line 21, in <module>
    from import file_mode_checker
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/", line 24, in <module>
    from import (
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/", line 98, in <module>
    from pywikibot import config2 as config
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/", line 392, in <module>
    base_dir = get_base_dir()
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/", line 386, in get_base_dir
    raise RuntimeError(exc_text)
RuntimeError: No found in directory '/mnt/nfs/labstore-secondary-tools-project/svgworkaroundbot'.
  Please check that is stored in the correct location.
  Directory where is searched is determined as follows:

    Return the directory in which user-specific information is stored.

    This is determined in the following order:
     1.  If the script was called with a -dir: argument, use the directory
         provided in this argument.
     2.  If the user has a PYWIKIBOT_DIR environment variable, use the value
         of it.
     3.  If user-config is present in current directory, use the current
     4.  If user-config is present in directory, use that directory
     5.  Use (and if necessary create) a 'pywikibot' folder under
         'Application Data' or 'AppData\Roaming' (Windows) or
         '.pywikibot' directory (Unix and similar) under the user's home

    Set PYWIKIBOT_NO_USER_CONFIG=1 to disable loading

    @param test_directory: Assume that a user config file exists in this
        directory. Used to test whether placing a user config file in this
        directory will cause it to be selected as the base directory.
    @type test_directory: str or None
    @rtype: str


Zhuyifei1999 wrote at

This looks like a bug from some recent pywikibot change.


Related Gerrit Patches:

Event Timeline

Restricted Application added a subscriber: pywikibot-bugs-list. · View Herald TranscriptMar 31 2019, 9:20 PM
Xqt triaged this task as High priority.Apr 1 2019, 4:34 AM
Xqt added a subscriber: Xqt.

Change 500389 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] Revert "[bugfix] Fix error thrown on saving"

Xqt closed this task as Resolved.Apr 1 2019, 7:56 AM
Xqt claimed this task.

Change 500389 merged by jenkins-bot:
[pywikibot/core@master] Revert "[bugfix] Fix error thrown on saving"