[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2016-07-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2016-07-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 62da75b29b29 by Serhiy Storchaka in branch 'default':
Issue #21708: Deprecated dbm.dumb behavior that differs from common dbm
https://hg.python.org/cpython/rev/62da75b29b29

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2016-06-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated. Added What's New entry.

We already lost 2 years and the 3.5 release. I don't want to lost 3.6 too.

--
assignee:  -> serhiy.storchaka
components: +Library (Lib)
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file43477/dbm_dumb_deprecations2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2015-05-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Warnings are not raised by default. They are raised only when the database is 
opened with the 'r' mode and then modified.

The earlier we start deprecation period, the earlier we could add true 
"read-only" and "update existing" modes to dbm.dumb.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2014-06-24 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Feel free to ignore my advice and make unnecessary changes to a very old, 
stable API.

--
assignee: rhettinger -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2014-06-24 Thread R. David Murray

R. David Murray added the comment:

The point is to make the API consistent.  So if the other dbm modules raise an 
error when __setitem__/__delitem__ are called on an R/O db, then the warnings 
are appropriate (but should mention that this will be an error in the future).

The warnings will only be printed once per run of python, unless I'm completely 
misremembering how deprecation warnings work.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2014-06-24 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm not worries about the performance.  I think the warnings and checks don't 
need to be there are all (API creep).  AFAICT, this has never been requested or 
needed in the entire history of the dumbdbm.

Your original goal of changing the default update mode is worthwhile.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2014-06-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Raymond for your attention.

Readonly warnings are emitted only when dumpdbm database opened in read only 
mode. They will be turned into exceptions in future (3.6 or 3.7). Annoying 
warnings on changed in future operations is desirable effect.

If you worry about performance hit of such checks, __setitem__ and __delitem__ 
are expensive operations doing file I/O.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2014-06-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The core idea is reasonable.  

The patch overreaches by adding readonly warnings to __setitem__ and 
__delitem__ which will spew-out on every call (these could be ignored or set to 
warn once by the user but that is PITA).

Minor nit.  We have a little PEP-8 overkill on the string splits:

+with self.assertWarnsRegex(DeprecationWarning,
+   "The database file is missing, the "
+   "semantics of the 'c' flag will "
+   "be used."):

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2014-06-20 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: serhiy.storchaka -> rhettinger
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21708] Deprecate nonstandard behavior of a dumbdbm database

2014-06-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Unlike to other dbm implementations, a dumpdbm database is always opened for 
update, and will be created if it does not exist.  We can fix this discrepancy 
and implement common behavior for 'r' and 'w' modes, but this will change 
current behavior and some deprecation period is needed.

Here is a patch (based on patch by Claudiu Popa, submitted in issue18039), 
which adds deprecation warnings for cases when current behavior differs from 
desired: invalid values for the flag parameter (will raise ValueError in 
future), opening non-existing database in 'r' or 'w' mode (will raise 
dbm.dumb.error), modifying a database opened for reading only (will raise 
dbm.dumb.error).

This patch needs approving by other core developer.

--
assignee: serhiy.storchaka
files: dbm_dumb_deprecations.patch
keywords: patch
messages: 220185
nosy: Claudiu.Popa, r.david.murray, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Deprecate nonstandard behavior of a dumbdbm database
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file35558/dbm_dumb_deprecations.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com