helpers is not compatible with python 3

Bug #1243467 reported by Curtis Hovey
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Charm Helpers
Fix Released
High
Stuart Bishop

Bug Description

Since Ubuntu raring, python2 is not installed by default. Trusty will be the first LTS to not ship with py2. Charms that use charm-helpers must install python2 to work. It may be possible to rewrite charm-helpers by py2 and py3 compatible so that charms can be deployed on precise and trusty.

$ python3 /usr/bin/pocketlint -q `find . -name '*.py'`
./charmhelpers/contrib/saltstack/__init__.py
     130: undefined name 'unicode'
./charmhelpers/contrib/jujugui/utils.py
     428: Could not compile; invalid syntax: except OSError, e:
./charmhelpers/contrib/openstack/context.py
     274: undefined name 'basestring'
./charmhelpers/fetch/__init__.py
      67: undefined name 'basestring'
      67: undefined name 'basestring'
./charmhelpers/fetch/archiveurl.py
      40: Could not compile; invalid token: mkdir(dest_dir, perms=0755)
./charmhelpers/core/host.py
     110: Could not compile; invalid token: def mkdir(path, owner='root', group='root', perms=0555, force=False):
./tools/charm_helpers_sync/charm_helpers_sync.py
     163: Could not compile; invalid syntax: except Exception, e:
./tests/contrib/network/test_ovs.py
      15: undefined name 'file'
./tests/contrib/jujugui/test_utils.py
       7: 'dumps' imported but unused
./tests/contrib/openstack/test_openstack_utils.py
     295: undefined name 'file'
     330: undefined name 'file'
     382: undefined name 'file'
./tests/contrib/openstack/test_os_contexts.py
      18: undefined name 'file'
./tests/fetch/test_fetch.py
      20: undefined name 'file'
./tests/core/test_host.py
     310: Could not compile; invalid token: perms = 0644
./tests/core/test_hookenv.py
     156: undefined name 'basestring'

Tags: py3 trusty

Related branches

Stuart Bishop (stub)
Changed in charm-helpers:
assignee: nobody → Stuart Bishop (stub)
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.