Bug 706815 - zanata-python-client does not handle version in format x.y.z
zanata-python-client does not handle version in format x.y.z
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-PythonClient (Show other bugs)
1.3
Unspecified All
unspecified Severity urgent
: ---
: ---
Assigned To: zanata-dev-internal
Ding-Yi Chen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-23 02:13 EDT by Ding-Yi Chen
Modified: 2011-10-27 00:30 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-10-27 00:30:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ding-Yi Chen 2011-05-23 02:13:41 EDT
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 04:25:12 EDT
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 00:22:42 EDT
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.