Page MenuHomePhabricator

Invalid version number (ValueError exception) for newest pypi version
Closed, ResolvedPublic

Description

Hello,

Sometime between yesterday and today, my error logs have been flooded by ValueError exceptions like the one below.

Traceback (most recent call last):
  File "dikantenyvaovao.py", line 346, in on_pubmsg
    self.translations.process_interwiki(lang, Page)
  File "dikantenyvaovao.py", line 505, in process_interwiki
    if Page.isRedirectPage():
  File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/page.py", line 633, in isRedirectPage
    return self.site.page_isredirect(self)
  File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/site.py", line 2542, in page_isredirect
    self.loadpageinfo(page)
  File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/site.py", line 2432, in loadpageinfo
    inprop=inprop)
  File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/site.py", line 1587, in _generator
    gen = gen_class(type_arg, site=self, **args)
  File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/data/api.py", line 2457, in __init__
    QueryGenerator.__init__(self, prop=prop, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/data/api.py", line 2040, in __init__
    if MediaWikiVersion(self.site.version()) < MediaWikiVersion('1.21'):
  File "/usr/lib/python2.7/distutils/version.py", line 40, in __init__
    self.parse(vstring)
  File "/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/tools/__init__.py", line 331, in parse
    raise ValueError('Invalid version number "{0}"'.format(vstring))
ValueError: Invalid version number "1.27.0-wmf.1"

Event Timeline

Jagwar raised the priority of this task from to Needs Triage.
Jagwar updated the task description. (Show Details)
Jagwar subscribed.
Jagwar renamed this task from Invalid revision number to Invalid version number (ValueError exception).Oct 1 2015, 8:38 PM
Jagwar triaged this task as Medium priority.
Jagwar updated the task description. (Show Details)
Jagwar added a project: Pywikibot-Commons.
Jagwar set Security to None.

In this specific case upgrading to 2.0rc3 should suffice.

Ok, thanks :)
Codes at the repository seems to be quite messy right now... 5 tries to get a version that can be successfully installed is too many...

What do you mean with 5 tries?

XZise renamed this task from Invalid version number (ValueError exception) to Invalid version number (ValueError exception) for newest pypi version.Oct 2 2015, 3:22 PM
XZise reopened this task as Open.
XZise raised the priority of this task from Medium to Unbreak Now!.
XZise added a project: Pywikibot.

Okay just checked, the pypi version hasn't been updated though.

Sorry for having been so vague about that issue in my previous message. I just meant that when trying to install the latest version from

https://git.wikimedia.org/git/pywikibot/core.git

with

sudo python setup.py install

I get the following error:

running install
running bdist_egg
running egg_info
creating pywikibot.egg-info
writing requirements to pywikibot.egg-info/requires.txt
writing pywikibot.egg-info/PKG-INFO
writing top-level names to pywikibot.egg-info/top_level.txt
writing dependency_links to pywikibot.egg-info/dependency_links.txt
writing manifest file 'pywikibot.egg-info/SOURCES.txt'
reading manifest file 'pywikibot.egg-info/SOURCES.txt'
writing manifest file 'pywikibot.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
Traceback (most recent call last):
  File "setup.py", line 211, in <module>
    use_2to3=False
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.linux-x86_64/egg/setuptools/command/install.py", line 73, in run
  File "build/bdist.linux-x86_64/egg/setuptools/command/install.py", line 93, in do_egg_install
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 185, in run
  File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 171, in call_command
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.linux-x86_64/egg/setuptools/command/install_lib.py", line 20, in run
  File "/usr/lib/python2.7/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_py')
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.linux-x86_64/egg/setuptools/command/build_py.py", line 89, in run
  File "/usr/lib/python2.7/distutils/command/build_py.py", line 373, in build_packages
    self.build_module(module, module_file, package)
  File "build/bdist.linux-x86_64/egg/setuptools/command/build_py.py", line 106, in build_module
  File "/usr/lib/python2.7/distutils/command/build_py.py", line 334, in build_module
    "'package' must be a string (dot-separated), list, or tuple")
TypeError: 'package' must be a string (dot-separated), list, or tuple

But I guess this is another issue which has to be addressed separately. Furthermore I don't get this problem when trying to install from the 1ff1cec7a33df85ed0cd957bf01e3f744b7f0310 commit. The error, for now, reproduces on every platform so I guess this is a fairly serious issue. (see T114487)

Ehm you didn't link rPWBC1ff1cec7a33d but 44898b7. So with the 2.0 branch you are fine? But yes could you please open a separate bug for this thanks 😄

Oops my mistake for the wrong link to commit... It is now fixed.

T114487 is open.

Off topic: As a tip for phabricator, you don't need to actually link tasks but can just write it's ID (T114487) and the same happens (as you saw in my comment) with the git commit hash (if it contains at least 7 digits).

valhallasw claimed this task.

labs/tools/heritage now manages to install properly. Thanks!