[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Jonathan Ng
Jonathan Ng added the comment: #1 makes sense to be backported. On Thu, Dec 1, 2016 at 8:41 PM, Serhiy Storchaka <rep...@bugs.python.org> wrote: > > Serhiy Storchaka added the comment: > > This example is too artificial. > > But there is a real issue: opening read

[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Jonathan Ng
Jonathan Ng added the comment: I'm not sure how to create an OSError. But perhaps something like this: ''' from dbm import dumb import os db = dumb.open('temp', flag='n') db['foo'] = 'bar' db.close() db = dumb.open('temp', flag='r') print(len(db.keys())) db.close os.rename('temp.dir

[issue28847] dumbdbm should not commit if in read mode

2016-11-30 Thread Jonathan Ng
New submission from Jonathan Ng: Or at the very least, if there is an OSError in _update, an error should be raised instead of ignoring this error. In the current state of the code, if there was an OSError while reading the dirfile, the dirfile would be overwritten with a blank file when

[issue28847] dumbdbm should not commit if

2016-11-30 Thread Jonathan Ng
Changes by Jonathan Ng <jonatha...@gmail.com>: -- nosy: Jonathan Ng priority: normal severity: normal status: open title: dumbdbm should not commit if type: behavior ___ Python tracker <rep...@bugs.python.org> <http://bugs.python