can't import lsb_release in python3 anymore
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lsb (Ubuntu) |
Confirmed
|
Undecided
|
Barry Warsaw |
Bug Description
Ubuntu 12.10 (but grub2 says Debian Wheezy now?)
Python 3.2.3-6ubuntu3.1
Python 3.2.3 (default, Oct 19 2012, 19:53:16)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lsb_release
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
EOFError: EOF read where not expected
>>>
This is a problem because it causes extlinux to fail. The following printed in reply to sudo aptitude full-upgrade:
The following partially installed packages will be configured:
extlinux
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up extlinux (2:4.05+dfsg-6) ...
P: Checking for EXTLINUX directory... found.
Traceback (most recent call last):
File "/usr/bin/
import lsb_release
EOFError: EOF read where not expected
dpkg: error processing extlinux (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
extlinux
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up extlinux (2:4.05+dfsg-6) ...
P: Checking for EXTLINUX directory... found.
Traceback (most recent call last):
File "/usr/bin/
import lsb_release
EOFError: EOF read where not expected
dpkg: error processing extlinux (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
extlinux
I have solved this bug myself. These were the steps:
colin@colin:~$ find /usr/lib -name "lsb_release*" python2. 7/dist- packages/ lsb_release. py python2. 7/dist- packages/ lsb_release. pyc python3/ dist-packages/ lsb_release. py python3/ dist-packages/ __pycache_ _/lsb_release. cpython- 32.pyc
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
colin@colin:~$ sudo rm /usr/lib/ python3/ dist-packages/ __pycache_ _/lsb_release. cpython- 32.pyc
And to verify it worked:
colin@colin:~$ python3
Python 3.2.3 (default, Oct 19 2012, 19:53:16)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lsb_release
>>> quit()
colin@colin:~$
As you can see, no errors anymore on trying to import lsb_release. Running aptitude full-upgrade worked as well and finished configuring extlinux.