Page MenuHomePhabricator

svnversion failed
Closed, ResolvedPublic

Description

All scripts are emitting svnversion failed during initialisation. It is harmless, but distracting.

This is because it is tries to find the Pywikibot version using

  1. git
  2. svn
  3. nightly download

Details

Related Gerrit Patches:

Event Timeline

jayvdb created this task.Dec 3 2015, 8:14 PM
jayvdb raised the priority of this task from to Medium.
jayvdb updated the task description. (Show Details)
jayvdb added projects: PAWS, Pywikibot.
jayvdb added a subscriber: jayvdb.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptDec 3 2015, 8:14 PM

What is the logic it uses to find the source? I can just setup / install git inside properly if that'll help.

this is more a bug in pywikibot's code. Pywikibot may even have an existing bug about this.
PAWS could install svn as a temporary workaround.

@jayvdb I already have git installed, and in fact now git clone is what's used to provision pwb. Can you check if this is still happening?

I can't reproduce this anymore.

yuvipanda closed this task as Resolved.Dec 4 2015, 10:54 PM
yuvipanda claimed this task.

Yes, I think the git clone stuff made it work.

fwiw, the version checking can also be disabled with config.log_pywiki_repo_version = False (sensible) and revising the config.user_agent_format to not include a dynamic version (not sensible).

The svnversion failed message was also reported in T108801 and T97241#1255280 and T97248.

Xqt reopened this task as Open.Feb 28 2016, 12:55 PM
Xqt added a subscriber: Xqt.

reopened since this bug still occurs for svn repository.

Xqt removed yuvipanda as the assignee of this task.Feb 28 2016, 12:55 PM
C:\pwb\SVN\core>pwb.py version
svnversion failed
Pywikibot: pywikibot-core (aaa6c27, s8249, 2016/02/27, 17:51:59, OUTDATED)
Release version: 3.0-dev
requests version: 2.7.0
  cacerts: C:\Python27\lib\site-packages\requests\cacert.pem
    certificate test: ok
Python: 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
PYWIKIBOT2_DIR: Not set
PYWIKIBOT2_DIR_PWB: C:\pwb\SVN\core
PYWIKIBOT2_NO_USER_CONFIG: Not set
Config base dir: C:\pwb\SVN\core
...

Change 273766 had a related patch set uploaded (by Xqt):
[FEAT] Hide "svnversion failed" warning

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

Xqt claimed this task.Feb 28 2016, 2:17 PM
yuvipanda set Security to None.
jayvdb added a comment.Mar 3 2016, 4:06 PM

This can be disabled.

The problematic line is https://github.com/jaraco/setuptools_svn/blob/master/setuptools_svn/svn_utils.py#L311 is

log.warn("svnversion failed")

That is using distutils.log.warn , which can be disabled by calling distutils.log.set_threshold(distutils.log.ERROR) before invoking svninfo.get_revision() and then restoring the previous threshold afterwards. See https://bitbucket.org/carljm/python-distutils/src/default/log.py . I have confirmed this works for Python 2.6 to 3.5

Xqt added a comment.Mar 3 2016, 5:11 PM

@jayvdb great! Thanks!

Xqt added a comment.Mar 4 2016, 1:08 PM

set/reset warning level implemented.

Change 273766 merged by jenkins-bot:
[FEAT] Hide "svnversion failed" warning

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

Xqt closed this task as Resolved.Mar 20 2016, 5:22 PM