Page MenuHomePhabricator

version.py crashes on tool labs
Closed, ResolvedPublic

Description

Russell Blau 2014-02-24 02:45:56 CET
This just leads to a new error:

/usr/lib/python2.7/subprocess.py in _execute_child(self=<subprocess.Popen object>, args=['git.cmd', '--no-pager', 'log', '-1', '--pretty=format:"%ad|%an|%h|%H|%d"--abbrev-commit', '--date=iso'], executable='git.cmd', preexec_fn=None, close_fds=False, cwd='/shared/pywikipedia/rewrite', env=None, universal_newlines=False, startupinfo=None, creationflags=0, shell=False, p2cread=None, p2cwrite=None, c2pread=8, c2pwrite=9, errread=None, errwrite=None)

1247                     if fd is not None:
1248                         os.close(fd)

> 1249 raise child_exception

1250 
1251

child_exception = OSError(2, 'No such file or directory')

<type 'exceptions.OSError'>: [Errno 2] No such file or directory

args = (2, 'No such file or directory') 
child_traceback = 'Traceback (most recent call last):\n File "/usr/...st)\nOSError: [Errno 2] No such file or directory\n' 
errno = 2 
filename = None 
message = '' 
strerror = 'No such file or directory'

Basically, getversiondict() needs to be able to fail gracefully and return some kind of placeholder value if it isn't able to locate either a GIT or SVN version number, rather than throw an exception and stop the entire framework from executing.


Version: compat-(1.0)
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=61231

Details

Reference
bz61846

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:07 AM
bzimport set Reference to bz61846.
bzimport added a subscriber: Unknown Object (????).

@Sorawee in Bug 61231: at the very least, it should fail gracefully (reporting a revision -1, for example). Not being able to determine the version should not break bots.

This is still an issue for compat: > http://prntscr.com/34p865 (reported by Kolega2357 on IRC)

Compat version is not work only on Windows 7 and Windows XP.

Can you give us a crash report? What you want to do and what happens

Not working new version pywikipedia compat on Windows 7. Any script is not working on Windows 7.

Stacktrace seems to be in the picture in comment 3

oh, Okay, let me see what I can do

  • Bug 63235 has been marked as a duplicate of this bug. ***

https://gerrit.wikimedia.org/r/#/c/113185/3/pywikibot/version.py
I followed the indication, but I still have another problem:

c:\pywikipedia>login.py
Traceback (most recent call last):

File "c:\pywikipedia\login.py", line 59, in <module>
  import query
File "c:\pywikipedia\query.py", line 30, in <module>
  import wikipedia as pywikibot
File "c:\pywikipedia\wikipedia.py", line 176, in <module>
  from pywikibot import version
File "c:\pywikipedia\pywikibot\version.py", line 169
  date = time.strptime(data.readline()[:19], '%Y-%m-%dT%H:%M:%S')
  ^

IndentationError: unexpected indent

c:\pywikipedia>

Can I get pywikipedia old version not compat

(In reply to Amir Ladsgroup from comment #11)

Try this:
http://tools.wmflabs.org/dexbot/compat.zip

Yeah! this is work.

Amir Ladsgroup, it working and thanks

  • Bug 63280 has been marked as a duplicate of this bug. ***

The problem is a "missing" entry to the Git bin directory in the PATH environment variable.
I don't usually have it so I also get the error. Adding the path above fixes the problem.

no problem happens in line related to the subprocess of calling "git log" and since git is installed on Windows for almost everyone, check and see

I'm not sure what you mean.
I'm not saying git is not installed. I mean it's not accessible just by invoking "git" without any path. The script is assuming git.exe is in the Windows PATH, which is not necessarily the case.
Adding the git.exe directory to the PATH worked for me.

P.S. I'm referring to the error "The system could not find the file specified", as posted by Kolega2357 above.