Comment 0 for bug 707540

Revision history for this message
Evgeny Kapun (abacabadabacaba) wrote : Destroying apt_pkg.Cache object releases system lock

Binary package hint: python-apt

This code should work, but doesn't:

 >>> import apt_pkg
 >>> apt_pkg.init()
 >>> with apt_pkg.SystemLock():
 ... x = apt_pkg.Cache()
 ... del x
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 Traceback (most recent call last):
   File "<stdin>", line 3, in <module>
 SystemError: E:Not locked

Architecture: amd64
apt 0.8.10ubuntu1
python-apt 0.7.100.1ubuntu4