Hello, After upgrade to python-2.7.1 checkrestart fails: # checkrestart lsof: WARNING: can't stat() fuse.sshfs file system /home/andrew/sshfs/orionis Output information may be incomplete. Found 64 processes using old versions of upgraded files (37 distinct programs) (17 distinct packages) Traceback (most recent call last): File "/usr/sbin/checkrestart", line 495, in <module> main() File "/usr/sbin/checkrestart", line 219, in main package.initscripts = [ u for u in package.initscripts if u not in locals()['_[1]'] ] KeyError: '_[1]' $ eselect python list Available Python interpreters: [1] python2.6 [2] python2.7 * [3] python3.1 With python2.6 it works well. python-updater was used. I reinstalled checkrestart manually, but with no effect.
Created attachment 260345 [details] emerge --info
Created attachment 262139 [details, diff] fix for python 2.7 (due to bad programming practice) From http://docs.python.org/reference/expressions.html: "In Python 2.3 and later releases, a list comprehension "leaks" the control variables of each for it contains into the containing scope. However, this behavior is deprecated, and relying on it will not work in Python 3.0" The author relied on an obscure feature (explained here: http://code.activestate.com/recipes/204297-the-secret-name-of-list-comprehensions/) and should be notified. My suggestion would be to consistently use the "set" data type to prevent duplicate entries.
Thanks for the patch. I trust it works for python 2.7 as it does for 2.6, which I tested with. It's applied in -r1.