Bug 706815 - zanata-python-client does not handle version in format x.y.z
Summary: zanata-python-client does not handle version in format x.y.z
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Component-PythonClient
Version: 1.3
Hardware: Unspecified
OS: All
unspecified
urgent
Target Milestone: ---
: ---
Assignee: zanata-dev-internal
QA Contact: Ding-Yi Chen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-23 06:13 UTC by Ding-Yi Chen
Modified: 2011-10-27 04:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-10-27 04:30:27 UTC
Embargoed:


Attachments (Terms of Use)

Description Ding-Yi Chen 2011-05-23 06:13:41 UTC
Description of problem:

It seems like zanata-python-client pass version with string.atof(version).
However, if version is in format x.y.z (e.g. 1.3.1), the zanata-python-client fail with error like:

Traceback (most recent call last):
  File "/usr/bin/zanata", line 26, in <module>
    client.run()
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 1483, in run
    self._create_iteration(command_args)
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 387, in _create_iteration
    version_number = string.atof(version)
  File "/usr/lib64/python2.6/string.py", line 388, in atof
    return _float(s)
ValueError: invalid literal for float(): 1.3.1


Version-Release number of selected component (if applicable):
zanata-python-client


How reproducible:
Always

Steps to Reproduce:
1. Assume zanata.xml exists.
2. zanata version create 1 --url=<zanataServerUrl>
  
Actual results:
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 387, in _create_iteration
    version_number = string.atof(version)
  File "/usr/lib64/python2.6/string.py", line 388, in atof
    return _float(s)
ValueError: invalid literal for float(): 1.3.1


Expected results:
Proceed without error

Comment 1 James Ni 2011-05-25 08:25:12 UTC
Hi Dean,

I have modify the source code to fix this issue, you can check the commit 931bb6ed in devel branch of zanataclient to verify this issue. (I forget to add the bug number to commit, sorry for that!)

Best Regards

Comment 2 Ding-Yi Chen 2011-05-26 04:22:42 UTC
VERIFIED with commit 931bb6ed454d207a93e88b4a0e19713671741510

Please fill this bug number in when you submit the release to bodhi.


Note You need to log in before you can comment on or make changes to this bug.