"SyntaxError: invalid syntax" error on syntax_error.py

Bug #81857 reported by doclist
8
Affects Status Importance Assigned to Milestone
pylib (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: gnome-applets

The postinstall script for gnome-applets version 2.16.1-0ubuntu4 contains a compileall.py
directive which tries to compile /usr/lib/python2.4/site-packages/py-0.8.0_alpha2-py2.4.egg/py/test/testing/data/syntax_error.py
among others.
However, 'syntax_error.py' is test function designed to be malformed, invalid python (and thus uncompilable).

This is on Edgy Eft.

Workaround I used was to temporarily comment out the one line in syntax_error.py. Temporarily moving it somewhere else would also probably work.

Output of apt-get install
--------------------------------------------------------------------------
 Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up gnome-applets (2.16.1-0ubuntu4) ...
Compiling /usr/lib/python2.4/site-packages/py-0.8.0_alpha2-py2.4.egg/py/test/testing/data/syntax_error.py ...
  File "/usr/lib/python2.4/site-packages/py-0.8.0_alpha2-py2.4.egg/py/test/testing/data/syntax_error.py", line 3
    this is really not python
                            ^
SyntaxError: invalid syntax

dpkg: error processing gnome-applets (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 gnome-applets
E: Sub-process /usr/bin/dpkg returned an error code (1)
--------------------------------------------------------------------------------

Revision history for this message
doclist (dclist) wrote :

Should mention that this is Edgy.

description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

looks like a python-support bug

Revision history for this message
Sebastien Bacher (seb128) wrote :

what package ship that file?

Revision history for this message
doclist (dclist) wrote :

I just checked and it seems to come from Pylons which is not available in Ubuntu as a package (I installed it through easy_install).

Whether this is an Ubuntu bug I depends on whether
it is safe to assume that everything in site-packages that ends in .py is compilable. Otherwise I guess its Pylons fault.

Revision history for this message
doclist (dclist) wrote :

Actually it's not Pylons it the 'py testing' library (which is pulled in with Pylons easy_install).

http://codespeak.net/py/

Revision history for this message
R. Drew Davis (drewclist) wrote :

Synaptic tells me syntax_error.py on my system came from pylib 0.7. (python2.4-pylib version 0.7.20050829-0ubuntu1 if you want to be precise) http://<email address hidden>/msg00120.html weakly says the problem is fixed in pylib 0.9.

Not sure why Ubuntu is lagging back at pylib 0.7, but from what I can gather, that is the problem. Synaptic says my pylib is up to date, so I gather no more recent version is available in the repositories in my sources.list. (a copy of which I've attached to this note).

I can confirm that the suggested work-around of adding a # in front of the offending line of syntax_error.py so the line is a comment and not a syntax error does seem to work. I had synaptic re-install an arbitrarily picked one of the many packages (python-buffy was the one that caught my eye) that dpkg.log said were only half configured. Synaptic (or its underpinnings) seems to have taken that as the cue to finish up the install on the dozen or some packages that had been stumbling on this problem. Hopefully that will chase away that griping I seemed to be seeing from the package installer every time an update for my system came along. Here I should re-tell the story of the boy who called wolf as explanation as to why it is important to get rid of all those annoying little messages.

Revision history for this message
R. Drew Davis (drewclist) wrote :

Oops. I should have also mentioned that my system is running Ubuntu dapper.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

This is still an issue in Dapper

python2.4-pylib:
  Installed: 0.7.20050829-0ubuntu1

Changed in python-support:
status: New → Confirmed
Revision history for this message
Przemek K. (azrael) wrote :

Does this bug still appear in the latest Ubuntu version? (9.10 Karmic Koala)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers