0

After running dist-upgrade on one system I am getting this error:

Sorry: TypeError: compile() expected string without null bytesdpkg: error processing package python2.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python:
 python depends on python2.7 (>= 2.7.9-1~); however:
  Package python2.7 is not configured yet.

Same error happens when doing a manual dpkg -i:

aleph /var/cache/apt/archives # dpkg -r python2.7
(Reading database ... 39002 files and directories currently installed.)
Removing python2.7 (2.7.9-2) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for mime-support (3.58) ...

aleph /var/cache/apt/archives # dpkg -i python2.7_2.7.9-2_amd64.deb 
(Reading database ... 39380 files and directories currently installed.)
Preparing to unpack python2.7_2.7.9-2_amd64.deb ...
Unpacking python2.7 (2.7.9-2) over (2.7.9-2) ...
Setting up python2.7 (2.7.9-2) ...
Sorry: TypeError: compile() expected string without null bytesdpkg: error processing package python2.7 (--install):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for mime-support (3.58) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
 python2.7

This also breaks all other packages (ie rdiff-backup or xen).

I'm a bit puzzled, as I can't find any clear reference online. I've rebooted the server, tried apt-get (auto)clean, etc. All seems good (not a corrupt package or fs?).

What are the next steps I can try?

0

This was caused by a corrupt file.

I installed debsums, and ran it on all files. Grepping on FAILED.

One of the corrupt files was topics.py (/usr/lib/python2.7/pydoc_data/topics.py).

I transferred the file from another, working machine, to that one, and reinstalled python2.7.

It worked fine after that.

I also had a couple of segfaults (other issue?) -- which went away after a reboot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.