1. Oben Sonne
  2. poole
  3. Issues

Issues

Issue #8 resolved

Python 3 incompatibilities

Anonymous created an issue

Hey,

I'm trying to run poole on archlinux, but when I'm starting the process with : {{{

!bash

$ poole.py --init }}} I have this error : {{{

!python

File "/usr/bin/poole/poole.py", line 399 exec stmt in macros.copy() ^ SyntaxError: invalid syntax }}}

I've installed the poole directory in /usr/bin/ and update my path like that : {{{

!bash

$ export PATH=$PATH:/usr/bin/poole }}}

My site directory is in my dropbox in my home folder.

Python v3.2.2-2 is installed on my computer as well as python-markdown.

Any idea about this error ?

Thanks in advance,

Léo

Comments (6)

  1. Oben Sonne repo owner
    • changed status to open

    The problem here is that exec isn't a keyword anymore in Python 3 but a plain function. In other words, the exec ... syntax works only until Python 2.7.

    I try to make this Python 3 friendly ASAP. In the meantime you might run poole with a Python 2.7 installation.

  2. Oben Sonne repo owner

    Python 2/3 hack for the exec statement/function

    See http://docs.python.org/release/3.0.1/whatsnew/3.0.html for changes with regard to `exec`. The problem here is that we cannot use the function syntax in Poole already for Python 2.x since we need a qualified exec, and thus we need the `in` syntax which causes a syntax error in Py3.

    This workaround uses `execfile` in Py2 (which, as a function, does not cause syntax errors in Py3) and the `exec` function from the builtins in Py3.

    References issue 8.

    e529749635df

  3. Log in to comment