Page MenuHomePhabricator

version.py fails for svn
Closed, ResolvedPublic

Description

C:\pwb\SVN\compat>version.py
[Errno 2] No such file or directory: 'C:\\pwb\\SVN\\compat\\.svn/entries'
Serious import error; pywikibot not available - was it configured?
Traceback (most recent call last):
  File "C:\pwb\SVN\compat\version.py", line 20, in <module>
    pywikibot.output('Pywikibot: %s' % getversion())
AttributeError: 'module' object has no attribute 'output'

C:\pwb\SVN\compat>

C:\pwb\SVN\compat>touch.py
Traceback (most recent call last):
  File "C:\pwb\SVN\compat\touch.py", line 28, in <module>
    import wikipedia as pywikibot
  File "C:\pwb\SVN\compat\wikipedia.py", line 6062, in <module>
    versionrev=(version.getversiondict()["rev"])
  File "C:\pwb\SVN\compat\pywikibot\version.py", line 68, in getversiondict
    (tag, rev, date, hsh) = getversion_svn(_program_dir)
  File "C:\pwb\SVN\compat\pywikibot\version.py", line 128, in getversion_svn
    entries = open(os.path.join(_program_dir, '.svn/entries'))
IOError: [Errno 2] No such file or directory: 'C:\\pwb\\SVN\\compat\\.svn/entries'
C:\pwb\SVN\compat>

SVN Version is:
TortoiseSVN 1.8.11, Build 26392 - 64 Bit , 2015/03/19 18:50:20
Subversion 1.8.13, -release
apr 1.5.1
apr-util 1.5.4
serf 1.3.8
OpenSSL 1.0.2a 19 Mar 2015
zlib 1.2.8

Event Timeline

Xqt raised the priority of this task from to High.
Xqt updated the task description. (Show Details)
Xqt added a project: Pywikibot-compat.
Xqt added a subscriber: Xqt.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptApr 26 2015, 6:55 AM

Looks like setuptools.svn_utils does not work with SVN 1.8.13

The two recent core bugs were T95075 (1.8.11) & T95077 (1.6).

What is the SVN format? Does a .svn/entries file exist when you do a checkout? If so, what is inside it?

.svn/entries file does not exists (anymore) with svn 1.8.13 and tortoisesvn

Change 208084 had a related patch set uploaded (by Xqt):
[bugfix] enable version.py for SVN 1.8

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

On core, I have re-tested SVN 1.8.13 without .svn/entries, and it works correctly with setuptools and with setuptools_svn .

If you experience the problem with core, could you please do

python pwb.py shell -v -debug -log

In the log file will be an entry version algorithms exceptions: which will at least contain an exception for getversion_git (No such file or directory)

compat of course does not use setuptools or setuptools_svn , as the fix has not been backported.

I got:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.

C:\pwb\SVN\core>pwb.py shell -v -debug -log
The base directory is C:\pwb\SVN\core
WARNING: Running on Windows and transliteration_target is not set.
Please see https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Pywikibot/Wi
ndows
=== Pywikibot framework v2.0 -- Logging header ===
COMMAND: ['shell', '-v', '-debug', '-log']
DATE: 2015-05-03 08:53:29.874000 UTC
svnversion failed
WARNING: C:\pwb\SVN\core\pywikibot\version.py:97: DeprecationWarning: pywikibot.
version.getversion_svn is deprecated, use getversion_svn_setuptools instead.
  (tag, rev, date, hsh) = vcs_func(_program_dir)

WARNING: C:\pwb\SVN\core\pywikibot\version.py:245: DeprecationWarning: pywikibot
.version.svn_rev_info is deprecated, use getversion_svn_setuptools instead.
  tag, rev, date = svn_rev_info(_program_dir)

VERSION: pywikibot/__init__.py (, -1 (unknown), 2015/04/11, 13:48:27, n/a)
CONFIG FILE DIR: C:\pwb\SVN\core
PACKAGES:
  BaseHTTPServer (C:\Python27\lib\BaseHTTPServer.pyc) = 0.3
  SimpleHTTPServer (C:\Python27\lib\SimpleHTTPServer.pyc) = 0.6
  SocketServer (C:\Python27\lib\SocketServer.pyc) = 0.4
  _ctypes (C:\Python27\DLLs\_ctypes.pyd) = 1.1.0
  _hashlib (C:\Python27\DLLs\_hashlib.pyd) = ??
  _socket (C:\Python27\DLLs\_socket.pyd) = ??
  _ssl (C:\Python27\DLLs\_ssl.pyd) = ??
  cgi (C:\Python27\lib\cgi.pyc) = 2.6
  ctypes (C:\Python27\lib\ctypes\) = 1.1.0
  distutils (C:\Python27\lib\distutils\) = 2.7.9
  email (C:\Python27\lib\email\) = 4.0.3
  logging (C:\Python27\lib\logging\) = 0.5.1.2
  mwparserfromhell: No module named mwparserfromhell
  platform (C:\Python27\lib\platform.pyc) = 1.0.7
  pywikibot ([path unknown]) = ??
  re (C:\Python27\lib\re.pyc) = 2.2.1
  select (C:\Python27\DLLs\select.pyd) = ??
  setuptools (C:\Python27\lib\site-packages\setuptools\) = 7.0
  unicodedata (C:\Python27\DLLs\unicodedata.pyd) = ??
  urllib (C:\Python27\lib\urllib.pyc) = 1.17
  urllib2 (C:\Python27\lib\urllib2.pyc) = 2.7
MODULES:
=== === === === === === === === === === === === === ===
Pywikibot SVN repository
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
Welcome to the Pywikibot interactive shell!
>>>

command log entry is:

015-05-03 10:53:30 r-1 (unknown) Python 2.7.9 shell "-v" "-debug" "-log"

Shell-bot.log is:

2015-05-03 10:53:29             bot.py,  311 in     writelogheader: VERBOSE  === Pywikibot framework v2.0 -- Logging header ===
2015-05-03 10:53:29             bot.py,  314 in     writelogheader: VERBOSE  COMMAND: ['shell', '-v', '-debug', '-log']
2015-05-03 10:53:29             bot.py,  317 in     writelogheader: VERBOSE  DATE: 2015-05-03 08:53:29.874000 UTC
2015-05-03 10:53:30                  C, \pwb\SVN\core\pywikibot\version.py in C:\pwb\SVN\core\pywikibot\version.py:97: DeprecationWarning: pywikibot.version.getversion_svn is deprecated, use getversion_svn_setuptools instead: WARNING  97: DeprecationWarning: pywikibot.version.getversion_svn is deprecated, use getversion_svn_setuptools instead.
  (tag, rev, date, hsh) = vcs_func(_program_dir)
2015-05-03 10:53:30                  C, \pwb\SVN\core\pywikibot\version.py in C:\pwb\SVN\core\pywikibot\version.py:245: DeprecationWarning: pywikibot.version.svn_rev_info is deprecated, use getversion_svn_setuptools instead: WARNING  245: DeprecationWarning: pywikibot.version.svn_rev_info is deprecated, use getversion_svn_setuptools instead.
  tag, rev, date = svn_rev_info(_program_dir)
2015-05-03 10:53:30         version.py,  115 in     getversiondict: DEBUG    version algorithm exceptions:
{<function getversion_git at 0x03028530>: IOError(2, 'No such file or directory'), <function getversion_nightly at 0x03028BF0>: IOError(2, 'No such file or directory'), <function getversion_svn at 0x03028DF0>: IOError(2, 'No such file or directory'), <function getversion_svn_setuptools at 0x030284F0>: ParseError(u'SvnInfo: invalid workarea',)}
2015-05-03 10:53:30             bot.py,  322 in     writelogheader: VERBOSE  VERSION: pywikibot/__init__.py (, -1 (unknown), 2015/04/11, 13:48:27, n/a)
2015-05-03 10:53:30             bot.py,  331 in     writelogheader: VERBOSE  CONFIG FILE DIR: C:\pwb\SVN\core
2015-05-03 10:53:30             bot.py,  344 in     writelogheader: VERBOSE  PACKAGES:
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    BaseHTTPServer (C:\Python27\lib\BaseHTTPServer.pyc) = 0.3
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    SimpleHTTPServer (C:\Python27\lib\SimpleHTTPServer.pyc) = 0.6
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    SocketServer (C:\Python27\lib\SocketServer.pyc) = 0.4
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    _ctypes (C:\Python27\DLLs\_ctypes.pyd) = 1.1.0
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    _hashlib (C:\Python27\DLLs\_hashlib.pyd) = ??
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    _socket (C:\Python27\DLLs\_socket.pyd) = ??
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    _ssl (C:\Python27\DLLs\_ssl.pyd) = ??
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    cgi (C:\Python27\lib\cgi.pyc) = 2.6
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    ctypes (C:\Python27\lib\ctypes\) = 1.1.0
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    distutils (C:\Python27\lib\distutils\) = 2.7.9
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    email (C:\Python27\lib\email\) = 4.0.3
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    logging (C:\Python27\lib\logging\) = 0.5.1.2
2015-05-03 10:53:30             bot.py,  355 in     writelogheader: VERBOSE    mwparserfromhell: No module named mwparserfromhell
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    platform (C:\Python27\lib\platform.pyc) = 1.0.7
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    pywikibot ([path unknown]) = ??
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    re (C:\Python27\lib\re.pyc) = 2.2.1
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    select (C:\Python27\DLLs\select.pyd) = ??
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    setuptools (C:\Python27\lib\site-packages\setuptools\) = 7.0
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    unicodedata (C:\Python27\DLLs\unicodedata.pyd) = ??
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    urllib (C:\Python27\lib\urllib.pyc) = 1.17
2015-05-03 10:53:30             bot.py,  357 in     writelogheader: VERBOSE    urllib2 (C:\Python27\lib\urllib2.pyc) = 2.7
2015-05-03 10:53:30             bot.py,  360 in     writelogheader: VERBOSE  MODULES:
2015-05-03 10:53:30             bot.py,  373 in     writelogheader: VERBOSE  === === === === === === === === === === === === === === 
2015-05-03 10:53:30             bot.py,  835 in        handle_args: INFO     Pywikibot SVN repository
2015-05-03 10:53:30             bot.py,  836 in        handle_args: INFO     Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
2015-05-03 10:53:30             bot.py,  842 in        handle_args: DEBUG    handle_args() completed.

At last pwb-bot.log gives me:

2015-05-03 10:53:29            http.py,  102 in           <module>: VERBOSE  Starting 1 threads...
2015-05-03 10:53:30                  C, \pwb\SVN\core\pywikibot\version.py in C:\pwb\SVN\core\pywikibot\version.py:97: DeprecationWarning: pywikibot.version.getversion_svn is deprecated, use getversion_svn_setuptools instead: WARNING  97: DeprecationWarning: pywikibot.version.getversion_svn is deprecated, use getversion_svn_setuptools instead.
  (tag, rev, date, hsh) = vcs_func(_program_dir)
2015-05-03 10:53:30                  C, \pwb\SVN\core\pywikibot\version.py in C:\pwb\SVN\core\pywikibot\version.py:245: DeprecationWarning: pywikibot.version.svn_rev_info is deprecated, use getversion_svn_setuptools instead: WARNING  245: DeprecationWarning: pywikibot.version.svn_rev_info is deprecated, use getversion_svn_setuptools instead.
  tag, rev, date = svn_rev_info(_program_dir)

Hmm. I am not seeing any clues why it isnt working. Is your .svn directory C:\pwb\SVN\core\.svn ?

Yes, i have C:\pwb\SVN\core\.svn and C:\pwb\SVN\compat\.svn. But there is no /entries file in it

Change 208084 merged by jenkins-bot:
[bugfix] enable version.py for SVN 1.8

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