1. Klaus Koch
  2. hgsnap
  3. Issues
Issue #12 new

Incompatibility with Python 2.4

Magnus Klingenberg
created an issue

Hi,

I've been trying to get hgsnap to work on CentOs 5, which has a parallel installation of Python 2.4 and 2.6. This problem exist with the packaged Mercurial which is built against Python 2.4.

When trying to launch hg with hsnap enabled {{{ [extensions] hgext.snap = path/to/snap.py }}} I get the following error: {{{ *** failed to import extension hgext.snap from /home/klingenm/hgext/hgsnap/snap.py: invalid syntax (snap.py, line 854) }}} The same configuration runs nicely on a debian box with Python 2.5. I have tried using different versions of Mercurial (1.6.4 through 1.9), but the failure seems to be linked to the Python version. Not familiar with Python myself. But seems to be related to exception handling.

{{{

!python

   try:
        d = dict(l.replace(': ', '=').split('=', 1) for l in meta)
    except:
        raise util.Abort(_('metadata %s in file %s is corrupted') % name)

854-> finally: meta.close()

}}}

The obeve line nuber and code is from cs:ec82df41a2b5 (branch:hg_1.7.5/TortoiseHG_1.1.9.1).

Tried to remove the failing code, but all similar exception code triggers the same error. Maybe there's some change between 2.4 and 2.5 regarding exception handling?

Comments (1)

  1. Log in to comment