Upgrade to raring fails in prerm

Bug #1157687 reported by LaMont Jones
64
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Virtualenv
New
Undecided
Unassigned
python2.7 (Debian)
Fix Released
Unknown
python2.7 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

During an upgrade to raring (from quantal), the prerm script tries to use things that are not defined. There are broken Dependencies in the package.

----

Preparing to replace python-novaclient 1:2.9.0-0ubuntu1 (using .../python-novaclient_1%3a2.11.1-0ubuntu1_all.deb) ...
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 562, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 544, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 236, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 548, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 475, in get_config_vars
    import re
  File "/usr/lib/python2.7/re.py", line 105, in <module>
    import sre_compile
  File "/usr/lib/python2.7/sre_compile.py", line 14, in <module>
    import sre_parse
  File "/usr/lib/python2.7/sre_parse.py", line 17, in <module>
    from sre_constants import *
  File "/usr/lib/python2.7/sre_constants.py", line 18, in <module>
    from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 562, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 544, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 236, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 548, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 475, in get_config_vars
    import re
  File "/usr/lib/python2.7/re.py", line 105, in <module>
    import sre_compile
  File "/usr/lib/python2.7/sre_compile.py", line 14, in <module>
    import sre_parse
  File "/usr/lib/python2.7/sre_parse.py", line 17, in <module>
    from sre_constants import *
  File "/usr/lib/python2.7/sre_constants.py", line 18, in <module>
    from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT
dpkg: error processing /var/cache/apt/archives/python-novaclient_1%3a2.11.1-0ubuntu1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 562, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 544, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 236, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 548, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 475, in get_config_vars
    import re
  File "/usr/lib/python2.7/re.py", line 105, in <module>
    import sre_compile
  File "/usr/lib/python2.7/sre_compile.py", line 14, in <module>
    import sre_parse
  File "/usr/lib/python2.7/sre_parse.py", line 17, in <module>
    from sre_constants import *
  File "/usr/lib/python2.7/sre_constants.py", line 18, in <module>
    from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-novaclient (Ubuntu):
status: New → Confirmed
Revision history for this message
James Troup (elmo) wrote :

I had the same problem when upgrading from Q to R but I also had the same crash from a running local django 'runserver' instance, so the root cause for this may not be in python-novaclient.

Revision history for this message
Melissa Draper (melissa) wrote :

I'm getting this just trying to feed a requirements.txt file into pip inside a virtualenv.

Revision history for this message
Melissa Draper (melissa) wrote :

Recreated the virtualenv and it works again, so it must have been something in the virtualenv.

Revision history for this message
Roy (roi-jacobson1) wrote :

Got this error in pydev using a virtualenv after upgrade to raring.

Revision history for this message
Roy (roi-jacobson1) wrote :

And after reinstalling it's working again :)

Changed in python-novaclient (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Bartosz Radaczyński (radaczynski) wrote :

well i have the same issue upgrading to raring

Revision history for this message
gidantribal (aedo999) wrote :

same here

Revision history for this message
Javier Barroso (javibarroso) wrote :

There is a Debian Bug related (No comments for the moment):

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=704084

I have the problem while upgrading other packages.

Thank

Chuck Short (zulcss)
affects: python-novaclient (Ubuntu) → python2.7 (Ubuntu)
Revision history for this message
Matthias Klose (doko) wrote :

Selecting previously unselected package libpython2.7-minimal:amd64.
Unpacking libpython2.7-minimal:amd64 (from .../libpython2.7-minimal_2.7.3-16ubuntu2_am
d64.deb) ...
Replacing files in old package python2.7-minimal ...
[...]
Preparing to replace python-novaclient 1:2.9.0-0ubuntu1 (using .../python-novaclient_1
%3a2.11.1-0ubuntu1_all.deb) ...
Traceback (most recent call last):
[...]
Preparing to replace python2.7 2.7.3-5ubuntu4 (using .../python2.7_2.7.3-16ubuntu2_amd64.deb) ...
Unpacking replacement python2.7 ...
Preparing to replace python2.7-minimal 2.7.3-5ubuntu4 (using .../python2.7-minimal_2.7.3-16ubuntu2_amd64.deb) ...
Unpacking replacement python2.7-minimal ...

and after that this works again.

I don't see yet why the import fails, because the extensions didn't change, and _sre is built as a builtin anyway.

So maybe libpython2.7-minimal should break python2.7-minimal (<< earlier version)?

Changed in python2.7 (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.7 - 2.7.4-1ubuntu1

---------------
python2.7 (2.7.4-1ubuntu1) raring; urgency=low

  * Merge with Debian; remaining changes:
    - Build-depend on python:any instead of python.

python2.7 (2.7.4-1) experimental; urgency=low

  * Python 2.7.4 release.
    - Issue #17550: Fix the --enable-profiling configure switch.
    - Issue #15801 (again): With string % formatting, relax the type check
      for a mapping such that any type with a __getitem__ can be used on the
      right hand side.
    - Issue #17625: In IDLE, close the replace dialog after it is used.
    - Issue #17531: Fix tests that thought group and user ids were always
      the int type. Also, always allow -1 as a valid group and user id.
    - Issue 17538: Document XML vulnerabilties
  * Byte-compile files in libpython2.7-dbg.
  * libpython2.7-minimal: Break earlier python2.7-minimal versions.
    Closes: #704084. LP: #1157687.
  * Call python with -E -S for the byte compilation.
 -- Matthias Klose <email address hidden> Sat, 06 Apr 2013 17:45:49 +0200

Changed in python2.7 (Ubuntu):
status: Incomplete → Fix Released
Changed in python2.7 (Debian):
status: New → Fix Released
Revision history for this message
Timmie (timmie) wrote :

here's a workaround:
http://stackoverflow.com/a/16299628

If you are using virtualenvwrapper then you can recreate the virtualenv on top of the existing one (with no environment currently active):

mkvirtualenv <existing name>

which should pull in the latest (upgraded) python version from the system and fix any mismatch errors.

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.