Destroying pkgCacheFile releases system lock

Bug #707540 reported by Evgeny Kapun on 2011-01-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
High
Julian Andres Klode

Bug Description

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

(lines beginning with ... should be indented, but Launchpad collapses multiple spaces into one when not at the beginning of the line)

Architecture: amd64
apt 0.8.10ubuntu1
python-apt 0.7.100.1ubuntu4

description: updated
Julian Andres Klode (juliank) wrote :

APT's pkgCacheFile unlocks the system when destructed or closed. I'm not sure why.

affects: python-apt (Ubuntu) → apt (Ubuntu)
Changed in apt (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
status: New → Confirmed
summary: - Destroying apt_pkg.Cache object releases system lock
+ Destroying pkgCacheFile releases system lock
Changed in apt (Ubuntu):
status: Confirmed → In Progress
status: In Progress → Triaged
importance: Undecided → High
Julian Andres Klode (juliank) wrote :

I fixed this in 1.7.0, but forgot about this bug and tracked it in bug 1794053, so marking this as a duplicate.

Changed in apt (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers