Some plugins don't work in Python 2.5

Bug #432653 reported by Sebastian Kalinowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyjama
Fix Committed
Undecided
Unassigned

Bug Description

When I try to run latest version of pyjama (revision 253, experimental) using Python 2.5 on Debian Squeeze, I can't use few plugins: librefm & lastfm support, PVC, listenstats. When pyjama starts I get:

Traceback (most recent call last):
  File "/.../pyjama/modules/clPlugin.py", line 192, in __init__
    mod = __import__ (plugin['filename'])
  File "/.../pyjama/plugins/lastfm/__init__.py", line 36
    class main():
        ^
SyntaxError: invalid syntax

Error importing Plugin last.fm plugin (lastfm)
Traceback (most recent call last):
  File "/.../pyjama/modules/clPlugin.py", line 192, in __init__
    mod = __import__ (plugin['filename'])
  File "/.../pyjama/plugins/librefm/__init__.py", line 36
    class main():
        ^
SyntaxError: invalid syntax

Error importing Plugin libre.fm plugin (librefm)
Traceback (most recent call last):
  File "/.../pyjama/modules/clPlugin.py", line 192, in __init__
    mod = __import__ (plugin['filename'])
  File "/.../pyjama/plugins/listenstats/__init__.py", line 37
    class main():
        ^
SyntaxError: invalid syntax

Error importing Plugin Listen Statistics (listenstats)
Traceback (most recent call last):
  File "/.../pyjama/modules/clPlugin.py", line 192, in __init__
    mod = __import__ (plugin['filename'])
  File "/.../pyjama/plugins/PVC/__init__.py", line 46
    class main():
        ^
SyntaxError: invalid syntax

I think this is caused by '@threaded' decorator, because decorators for classes are implemented only in Python 2.6 (and 3.0). I was trying to use 'main=threaded(main)' instead of '@threaded' decorator, but when I do this threading in those plugins doesn't work.

Related branches

description: updated
Revision history for this message
Daniel Nögel (daniel-xn--ngel-5qa) wrote :

Hi Sebastian,

you are probably right - I am not using python2.5 any more and can not reproduce this bug.

The point is: I have a lot of work to do right now and the whole threading-concept of pyjama is kind of crap. A was thinking of a complete re-coding of pyjama - but I'll need time for that.
So for now I just can fix urgent issues. The bug you are reporting would take much time to fix for me and wouldn't even be useful for long time, since python2.5. will be replaced on most distributions.

As you have write permissions to the branch, you can fix this problem of course, if you want to. I would appreciate that.

Sincerely,

barabbas

Changed in pyjama:
status: New → Fix Committed
Revision history for this message
Daniel Nögel (daniel-xn--ngel-5qa) wrote :

Hey, thanks for your work!

I actually didn't knew that it would still work without the threaded-decorators!

best regards,

daniel

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.