[Bug 1093071] Re: can't import lsb_release in python3 anymore
Barry Warsaw
1093071 at bugs.launchpad.net
Wed May 15 14:08:28 UTC 2013
Actually, I think this bug is in line with many other related bugs Brian
has identified in Python 2. All of them seem to come down to corrupted
.pyc files, and all can be solved by essentially deleting the corrupted
pyc and regenerating it, as is the effect of the steps in comment #1.
What's interesting about this bug is that it's the first so far
identified for Python 3, but what's also interesting is that it's
reported against Python 3.2 not 3.3. So far, we've seen this bug
reported primarily against 2.7. The thing is that 3.2 and 2.7 share the
same algorithm for writing pyc files, attempting to get an exclusive
open on the file but *not* doing an atomic rename. In Python 3.3, with
the switch to importlib, the atomic rename has been added. So far, I
haven't seen this bug reported against Python 3.3 so I'm still going
with my working hypothesis which is that *something* as yet unidentified
is causing a race condition on writing the pyc files, thus truncating or
corrupting them. I need to analyze write_compiled_module() in import.c
in more detail to see if that's really possible. In parallel, more
analysis is needed to try to identify whether there are indeed multiple
writers to pyc files possible, e.g. during installation via ubiquity as
Colin pointed out in IRC, or because of some later case. There has to
be two processes that see the bare .py file and think they need to write
a .pyc file at the same time, *and* that the protections against
overwriting in import.c are not enough. The dual-writer process is as
yet still unidentified.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to lsb in Ubuntu.
https://bugs.launchpad.net/bugs/1093071
Title:
can't import lsb_release in python3 anymore
Status in “lsb” package in Ubuntu:
Confirmed
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/lsb_release", line 26, in <module>
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
Errors were encountered while processing:
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/lsb_release", line 26, in <module>
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
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/1093071/+subscriptions
More information about the foundations-bugs
mailing list