Page MenuHomePhabricator

IOError: [Errno 2] No such file or directory: 'D:\\Pybot\\.git/refs/heads/master'
Closed, DeclinedPublic

Description

Downloading compact from http://tools.wmflabs.org/pywikibot/ - the .zip doesn't contain any data in .git/refs/heads- which pybot requires to determine the version.

The following error occurs when I run generate-family-file.py on a newly unzipped zip from tools.wmflabs

D:\Pybot>generate_family_file.py
WARNING: Running on Windows and transliteration_target is not set.
Please see http://www.mediawiki.org/wiki/Manual:Pywikipediabot/Windows
Traceback (most recent call last):
  File "D:\Pybot\generate_family_file.py", line 50, in <module>
    import wikipedia
  File "D:\Pybot\wikipedia.py", line 6062, in <module>
    versionrev=(version.getversiondict()["rev"])
  File "D:\Pybot\pywikibot\version.py", line 70, in getversiondict
    (tag, rev, date, hsh) = getversion_git(_program_dir)
  File "D:\Pybot\pywikibot\version.py", line 188, in getversion_git
    hsh = open(os.path.join(_program_dir, '.git/refs/heads/master'), 'r').read()
.strip(" \n")
IOError: [Errno 2] No such file or directory: 'D:\\Pybot\\.git/refs/heads/master
'


D:\Pybot\.git\refs\heads>ls -l
total 0

Event Timeline

RansomTime raised the priority of this task from to Needs Triage.
RansomTime updated the task description. (Show Details)
RansomTime added a project: Pywikibot-compat.
RansomTime subscribed.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptJan 23 2015, 8:08 AM

This is definitely compat only, nightly only, and it only occurs when git (or git.cmd) isnt found. in the version detection algorithm, it git isnt found, it tries to use the master ref.

.git/refs/heads/ is also empty in core nightlies, but core's version.py doesnt try to use the refs this way.

@Ladsgroup , is the 'master' ref removed in your tarball size optimisations?

Aklapper triaged this task as Lowest priority.Jun 5 2015, 1:41 PM

Pywikibot has two versions: Compat and Core. This task was filed about the older version, called Pywikibot-compat, which is not under active development anymore. Hence I'm lowering the priority of this task to reflect the reality. Unfortunately, the Pywikibot team does not have the manpower to retest every single bug report / feature request against the (maintained) Pywikibot code base. Furthermore, the code base of Pywikibot-Compat has changed a lot compared to the code base of Pywikibot-Core so there is a chance that the problem described in this task might not exist anymore. Please help: Unfortunately manpower is limited and does not allow testing every single reported task again. If you have time and interest in Pywikibot, please upgrade to Pywikibot-Core and add a comment to this task if the problem in this task still happens in Pywikibot-Core (or directly edit the task by removing the Pywikibot-compat project and adding the Pywikibot project to this task). To learn more about Pywikibot and to get involved in its development, please check out https://www.mediawiki.org/wiki/Manual:Pywikibot/Development Thank you for your understanding.

Xqt subscribed.

compat is closed