SyntaxError in leoPlugins.py

1 view
Skip to first unread message

uve...@gmail.com

unread,
Dec 22, 2009, 2:11:16 AM12/22/09
to leo-editor
Hi,

after sometime without following the current leo development today
I've found time for upgrading my local repository.
So I'm with revision 2548. The problem is that leo doesn't start with
python 2.5

$ launchLeo.py &
$ *** isPython3: False
/usr/local/src/leo-editor/leo/core/leoPlugins.py:723: Warning: 'as'
will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/usr/local/src/leo-editor/launchLeo.py", line 7, in <module>
import leo.core.runLeo
File "/usr/local/src/leo-editor/leo/core/runLeo.py", line 50, in
<module>
import leo.core.leoApp as leoApp
File "/usr/local/src/leo-editor/leo/core/leoApp.py", line 11, in
<module>
import leo.core.leoPlugins as leoPlugins
File "/usr/local/src/leo-editor/leo/core/leoPlugins.py", line 723
except TryNext as exc:
^
SyntaxError: invalid syntax

[1]+ Fi d'execuci? amb l'estat 1 /usr/local/src/leo-editor/
launchLeo.py


Is just me, or other people is suffering the same problem?

Vicent

uve...@gmail.com

unread,
Dec 22, 2009, 2:23:14 AM12/22/09
to leo-editor

Hi again,

it seems the offending line was added in revision 2523 so I've
downgraded my local repo to rev 2522. But:


$ launchLeo.py &
$ *** isPython3: False

/usr/local/src/leo-editor/leo/external/pickleshare.py:205: Warning:


'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/usr/local/src/leo-editor/launchLeo.py", line 7, in <module>
import leo.core.runLeo
File "/usr/local/src/leo-editor/leo/core/runLeo.py", line 50, in
<module>
import leo.core.leoApp as leoApp

File "/usr/local/src/leo-editor/leo/core/leoApp.py", line 15, in
<module>
import leo.external.pickleshare
File "/usr/local/src/leo-editor/leo/external/pickleshare.py", line
205
except OSError as e:
^
SyntaxError: invalid syntax


FYI, before my problematic upgrade I was using revision 2453 without
problems.

Vicent

Ville M. Vainio

unread,
Dec 22, 2009, 2:55:56 AM12/22/09
to leo-e...@googlegroups.com
On Tue, Dec 22, 2009 at 9:11 AM, uve...@gmail.com <uve...@gmail.com>
wrote:

> So I'm with revision 2548. The problem is that leo doesn't start with
> python 2.5

You have to upgrade to Python 2.6. This is because 2.6 has some
python3 compatibility features that Leo uses.

--
Ville M. Vainio
http://tinyurl.com/vainio

uve...@gmail.com

unread,
Dec 22, 2009, 3:03:16 AM12/22/09
to leo-editor

Hi,

I see. The problem is that python 2.6 is still in debian experimental
and I'm using debian testing... I suppose I'll have to install python
2.6 from sources or just wait.

Anyway thanks for your help.

Vicent

Ville M. Vainio

unread,
Dec 22, 2009, 3:11:31 AM12/22/09
to leo-e...@googlegroups.com
On Tue, Dec 22, 2009 at 10:03 AM, uve...@gmail.com <uve...@gmail.com> wrote:

> I see. The problem is that python 2.6 is still in debian experimental
> and I'm using debian testing... I suppose I'll have to install python
> 2.6 from sources or just wait.

Are you sure? At least Sid has python 2.6...

uve...@gmail.com

unread,
Dec 22, 2009, 3:22:00 AM12/22/09
to leo-editor

?? That is not what says packages.debian.org. I'll further
investigate...

Vicent

Ville M. Vainio

unread,
Dec 22, 2009, 4:17:44 AM12/22/09
to leo-e...@googlegroups.com
On Tue, Dec 22, 2009 at 10:22 AM, uve...@gmail.com <uve...@gmail.com> wrote:

>> Are you sure? At least Sid has python 2.6...

> ?? That is not what says packages.debian.org. I'll further
> investigate...

I checked too, indeed it seems it has python 2.5.

I assumed Sid would have 2.6 because Karmic has it (2.6.4), and it was
branched from Sid 6 months ago....

uve...@gmail.com

unread,
Dec 22, 2009, 4:34:54 AM12/22/09
to leo-editor

Right. Bad luck for me.

Thanks for all.

Vicent

Edward K. Ream

unread,
Dec 22, 2009, 5:19:46 AM12/22/09
to leo-e...@googlegroups.com
On Tue, Dec 22, 2009 at 2:11 AM, uve...@gmail.com <uve...@gmail.com> wrote:

>  File "/usr/local/src/leo-editor/leo/core/leoPlugins.py", line 723
>    except TryNext as exc:
>                    ^
> SyntaxError: invalid syntax

There are only a few such instances in all of Leo at present. Rather
than requiring Python 2.6, I think it would be best to choose the
correct syntax based on the Python version. I'll attempt a fix today.

Edward

Ville M. Vainio

unread,
Dec 22, 2009, 5:28:40 AM12/22/09
to leo-e...@googlegroups.com
On Tue, Dec 22, 2009 at 12:19 PM, Edward K. Ream <edre...@gmail.com> wrote:

> There are only a few such instances in all of Leo at present.  Rather
> than requiring Python 2.6, I think it would be best to choose the
> correct syntax based on the Python version.  I'll attempt a fix today.

I don't think it's possible.

Edward K. Ream

unread,
Dec 22, 2009, 5:40:03 AM12/22/09
to leo-e...@googlegroups.com
On Tue, Dec 22, 2009 at 5:28 AM, Ville M. Vainio <viva...@gmail.com> wrote:
> On Tue, Dec 22, 2009 at 12:19 PM, Edward K. Ream <edre...@gmail.com> wrote:
>
>> There are only a few such instances in all of Leo at present.  Rather
>> than requiring Python 2.6, I think it would be best to choose the
>> correct syntax based on the Python version.  I'll attempt a fix today.
>
> I don't think it's possible.

You are correct. It won't help to "choose" the syntax with a switch,
because the offending syntax still gets parsed.

This is a nasty surprise.

The only way around this would be to create another leo3k branch, then
revert the trunk to the rev before the grand merge. This will allow
people to use Leo with Python 2.5 until Python 2.6 becomes more widely
available.

I dislike my choices:

1. Creating a new leo3k branch would delay wider testing of the leo3k
code. And I don't want to create branch that might not be merged for
months, even though no more changes are contemplated.

2. It seems unreasonable to force people to move to a version of
Python that is not widely available.

What do you all think?

Edward

Ville M. Vainio

unread,
Dec 22, 2009, 5:49:58 AM12/22/09
to leo-e...@googlegroups.com
On Tue, Dec 22, 2009 at 12:40 PM, Edward K. Ream <edre...@gmail.com> wrote:

> 2. It seems unreasonable to force people to move to a version of
> Python that is not widely available.
>
> What do you all think?

Let's force people to move to 2.6. It *is* widely available, and
that's the jump we need to take to get into py3k action at all.

By the time Leo 4.7 official version is out, everyone should have
python 2.6, I think...

Edward K. Ream

unread,
Dec 22, 2009, 7:41:44 AM12/22/09
to leo-e...@googlegroups.com

This is reasonable and it would seem to be the easiest path.

I suppose we could create a leo25 branch that will compile on Python 2.5...

Edward

Reply all
Reply to author
Forward
0 new messages