#3622 NUM_VERSION being converted to octal
Closed: Fixed None Opened 10 years ago by rcritten.

The change in ticket #3545 to make NUM_VERSION two digits is causing python to interpret the value as an octal since it has a leading 0:

$ python
Python 2.7.4 (default, May  3 2013, 09:39:35) 
[GCC 4.8.0 20130412 (Red Hat 4.8.0-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ipapython.version import NUM_VERSION
>>> print NUM_VERSION
12416

We didn't detect this during testing because this version is indeed higher than previous versions so creating replicas between older and newer versions still worked.

This is breaking the current builds in master too which changed the minor value to 99 which isn't valid in octal:

Traceback (most recent call last):
  File "./makeapi", line 31, in <module>
    from ipalib import api
  File "/home/rcrit/redhat/freeipa/ipalib/__init__.py", line 883, in <module>
    import plugable
  File "/home/rcrit/redhat/freeipa/ipalib/plugable.py", line 36, in <module>
    import errors
  File "/home/rcrit/redhat/freeipa/ipalib/errors.py", line 105, in <module>
    from ipalib.text import ngettext as ungettext
  File "/home/rcrit/redhat/freeipa/ipalib/text.py", line 118, in <module>
    from request import context
  File "/home/rcrit/redhat/freeipa/ipalib/request.py", line 26, in <module>
    from base import ReadOnly, lock
  File "/home/rcrit/redhat/freeipa/ipalib/base.py", line 25, in <module>
    from constants import NAME_REGEX, NAME_ERROR
  File "/home/rcrit/redhat/freeipa/ipalib/constants.py", line 26, in <module>
    from ipapython.version import VERSION
  File "/home/rcrit/redhat/freeipa/ipapython/version.py", line 25
    NUM_VERSION=030299
                     ^
SyntaxError: invalid token

The fix is challenging because we now have a version in the wild using an octal version that stands apart from all the other decimal versions, so we'll need some sort of special case for it one way or another.


This also affects the 3.1 release, 3.1.3 and 3.1.4.

Metadata Update from @rcritten:
- Issue assigned to pviktori
- Issue set to the milestone: FreeIPA 3.2.x - 2013/05 (bug fixing)

7 years ago

Login to comment on this ticket.

Metadata