Modify

Opened 4 months ago

Closed 5 weeks ago

Last modified 5 weeks ago

#13141 closed defect (fixed)

getAPIVersion invalid literal for int() with base 10: 'dev0'

Reported by: anonymous Owned by: jomae
Priority: normal Component: XmlRpcPlugin
Severity: blocker Keywords:
Cc: Olemis Lang, f.rochlitzer@… Trac Release: 1.0

Description

While using TracXMLRPC-1.1.7.dev0 we get the following error:

2017-04-07 10:50:59,029 Trac[web_ui] ERROR: RPC(XML-RPC) [xxx.xxx.xxx.xxx] Exception caught while calling system.getAPIVersion(*[]) by user
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/TracXMLRPC-1.1.7.dev0-py2.7.egg/tracrpc/web_ui.py", line 158, in _rpc_process
    result = (XMLRPCSystem(self.env).get_method(method_name)(req, args))[0]
  File "/usr/local/lib/python2.7/dist-packages/TracXMLRPC-1.1.7.dev0-py2.7.egg/tracrpc/api.py", line 197, in __call__
    result = self.callable(req, *args)
  File "/usr/local/lib/python2.7/dist-packages/TracXMLRPC-1.1.7.dev0-py2.7.egg/tracrpc/api.py", line 339, in getAPIVersion
    return map(int, tracrpc.__version__.split('-')[0].split('.'))
ValueError: invalid literal for int() with base 10: 'dev0'
2017-04-07 10:50:59,029 Trac[xml_rpc] ERROR: invalid literal for int() with base 10: 'dev0'
2017-04-07 10:50:59,030 Trac[xml_rpc] ERROR: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/TracXMLRPC-1.1.7.dev0-py2.7.egg/tracrpc/web_ui.py", line 158, in _rpc_process
    result = (XMLRPCSystem(self.env).get_method(method_name)(req, args))[0]
  File "/usr/local/lib/python2.7/dist-packages/TracXMLRPC-1.1.7.dev0-py2.7.egg/tracrpc/api.py", line 197, in __call__
    result = self.callable(req, *args)
  File "/usr/local/lib/python2.7/dist-packages/TracXMLRPC-1.1.7.dev0-py2.7.egg/tracrpc/api.py", line 339, in getAPIVersion
    return map(int, tracrpc.__version__.split('-')[0].split('.'))
ServiceException: invalid literal for int() with base 10: 'dev0'

It seems the 'dev0' string ist not allowed.

Attachments (0)

Change History (7)

comment:1 Changed 4 months ago by anonymous

Severity: normalblocker

Eclipse mylyn doesn't work anymore without an correct API version string.

comment:2 Changed 4 months ago by Rochi

Cc: f.rochlitzer@… added

comment:3 Changed 4 months ago by Rochi

I've fixed it with:
Line 339 in api.py

return map(int, tracrpc.__version__.split('-')[0].replace('.dev0', '').split('.'))

comment:4 Changed 4 months ago by Jun Omae

Work around:

  • xmlrpcplugin/trunk/tracrpc/api.py

    diff --git a/xmlrpcplugin/trunk/tracrpc/api.py b/xmlrpcplugin/trunk/tracrpc/api.py
    index 93ab86eb0..96bd5a4a0 100644
    a b class XMLRPCSystem(Component): 
    335335        version number, third is the minor. Changes to the major version
    336336        indicate API breaking changes, while minor version changes are simple
    337337        additions, bug fixes, etc. """
     338        import re
    338339        import tracrpc
    339         return map(int, tracrpc.__version__.split('-')[0].split('.'))
     340        match = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)', tracrpc.__version__)
     341        return map(int, match.groups())

comment:6 Changed 5 weeks ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 16674:

TracXMLRPC 1.1.7dev: Fix exception in getAPIVersion when version contains dev

Patch by Jun Omae.

Fixes #13141.

comment:7 Changed 5 weeks ago by Ryan J Ollos

Owner: changed from Odd Simon Simonsen to jomae

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain jomae.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.