[issue19282] dbm.open should be a context manager

2014-03-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 200207e50cbf by R David Murray in branch 'default': whatsnew: dbm.open is context manager. (#19282) http://hg.python.org/cpython/rev/200207e50cbf -- ___ Python tracker rep...@bugs.python.org

[issue19282] dbm.open should be a context manager

2013-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset c2f1bb56760d by Nick Coghlan in branch 'default': Close #19282: Native context management in dbm http://hg.python.org/cpython/rev/c2f1bb56760d -- nosy: +python-dev resolution: - fixed stage: patch review - committed/rejected status: open -

[issue19282] dbm.open should be a context manager

2013-11-16 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks Claudiu! Additional tweaks in the committed version: - added a paragraph to the docs about the with statement support and moved the versionchanged note there - changed the example in the docs to use a with statement - added a basic test that the dumbdbm

[issue19282] dbm.open should be a context manager

2013-11-16 Thread Nick Coghlan
Nick Coghlan added the comment: I also changed the signature of the enter/exit methods to just use PyObject * (rather than dbmobject *), since that allowed a bunch of casts to be removed and eliminated a couple of compiler warnings about type mismatches. --

[issue19282] dbm.open should be a context manager

2013-11-16 Thread Claudiu.Popa
Claudiu.Popa added the comment: Cool, thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19282 ___ ___ Python-bugs-list mailing list

[issue19282] dbm.open should be a context manager

2013-10-31 Thread Nick Coghlan
Nick Coghlan added the comment: Patch looks reasonable to me - if nobody beats me to it, I'll commit this before beta 1 :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19282 ___

[issue19282] dbm.open should be a context manager

2013-10-28 Thread Claudiu.Popa
Claudiu.Popa added the comment: There is issue19385 for the inconsistency of dbm.dumb, with a patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19282 ___

[issue19282] dbm.open should be a context manager

2013-10-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems like a reasonable request. -- assignee: - ncoghlan nosy: +ncoghlan, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19282 ___

[issue19282] dbm.open should be a context manager

2013-10-19 Thread Claudiu.Popa
Claudiu.Popa added the comment: Attached patch checks that the db is actually closed after the `with`. Also, I noticed that dbm.dumb doesn't behave like the rest of the variants, as seen in the following: import dbm.dumb as d db = d.open('test.dat', 'c') db.close() db.keys() Traceback

[issue19282] dbm.open should be a context manager

2013-10-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree with the revised title. Test_context_manager() should also test that db is actually closed after the with statement. I presume you can use self.assertRaises and try to do something with db that will fail if it is properly closed. with