[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-25 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: r67380 has the fix. Thanks for the review, Skip! -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-24 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: specify_open_encoding.diff has been committed in r67369. I still need a review for doc_dbm_strings.diff, though, which clarifies the docs, fixes one oversight in dbm.dumb, and extends testing to make sure strings can be accepted.

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-24 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: -- components: +Library (Lib) stage: needs patch - commit review ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-24 Thread Skip Montanaro
Skip Montanaro [EMAIL PROTECTED] added the comment: Brett I still need a review for doc_dbm_strings.diff, though, which Brett clarifies the docs, fixes one oversight in dbm.dumb, and extends Brett testing to make sure strings can be accepted. Was my comment

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-24 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: On Mon, Nov 24, 2008 at 16:25, Skip Montanaro [EMAIL PROTECTED] wrote: Skip Montanaro [EMAIL PROTECTED] added the comment: Brett I still need a review for doc_dbm_strings.diff, though, which Brett clarifies the docs, fixes one oversight

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-22 Thread Skip Montanaro
Skip Montanaro [EMAIL PROTECTED] added the comment: py3k patched with specify_open_encoding.diff passes test_dbm_dumb on my Mac (Leopard, Intel). Might as well assign this to Brett. He seems to be doing all the heavy lifting anyway. ;-) Skip -- assignee: - brett.cannon

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Barry A. Warsaw
Changes by Barry A. Warsaw [EMAIL PROTECTED]: -- priority: deferred blocker - release blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Skip Montanaro
Skip Montanaro [EMAIL PROTECTED] added the comment: damn... my cc to [EMAIL PROTECTED] didn't work. Here's the recap (message to python-checkins): me ... I thought Guido was of the opinion that the 3.0 version should me be able to read dumb dbms written by earlier Python versions

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Skip Montanaro
Changes by Skip Montanaro [EMAIL PROTECTED]: Added file: http://bugs.python.org/file12096/mydb3read.py ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: So the use of pickle is not fair as that doesn't round-trip if you simply write out a file because py3k pickle doesn't like classic classes and the new-style classes want copy_reg which is not in existence in py3k since it was renamed. See

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: Added file: http://bugs.python.org/file12099/mydb2write.py ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: Added file: http://bugs.python.org/file12100/mydb3read.py ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___ ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: -- resolution: accepted - ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___ ___ Python-bugs-list

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Skip Montanaro
Skip Montanaro [EMAIL PROTECTED] added the comment: Brett In other words I think my solution works and pickle is the Brett trouble-maker in all of this. I can buy that. Should pickle map copy_reg to copyreg? Is that the only incompatibility? Actually, it seems this ticket should be

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: On Fri, Nov 21, 2008 at 10:32, Skip Montanaro [EMAIL PROTECTED] wrote: Skip Montanaro [EMAIL PROTECTED] added the comment: Brett In other words I think my solution works and pickle is the Brett trouble-maker in all of this. I can buy

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Skip Montanaro
Skip Montanaro [EMAIL PROTECTED] added the comment: One doc nit: There is still reference to ``gdbm`` and Dbm (or dbm) objects when they should probably use ``dbm.gnu`` and ``dbm.ndbm``, respectively. I'm confused by the encoding=Latin-1 args to _io.open for dbm.dumb. I thought the default

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread STINNER Victor
Changes by STINNER Victor [EMAIL PROTECTED]: -- nosy: -haypo ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___ ___ Python-bugs-list mailing list

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-21 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: On Fri, Nov 21, 2008 at 11:01, Skip Montanaro [EMAIL PROTECTED] wrote: Skip Montanaro [EMAIL PROTECTED] added the comment: One doc nit: There is still reference to ``gdbm`` and Dbm (or dbm) objects when they should probably use ``dbm.gnu``

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-20 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: -- keywords: +needs review stage: - commit review ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-20 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: r67310 has the fix. -- resolution: - accepted status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-20 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: I am re-opening this as a deferred blocker with a patch to document that dbm implementations write out and return bytes, but that strings are accepted and implicitly converted. -- priority: release blocker - deferred blocker status:

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-20 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: Have another patch that fixes all open() calls to specify the file encoding in dbm.dumb. Also caught one spot in _addkey() where decode(Latin-1) was not being called. Added file: http://bugs.python.org/file12085/specify_open_encoding.diff

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-19 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: If you look at the 2.7 code all it requires of keys and values in __setitem__ is that they are strings; there is nothing about Latin-1 in terms of specific encoding (must be a 3.0 addition to make the str/unicode transition the easiest). That

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-19 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: OK, now I see why it is called 'dumb'; the thing literally just dumps out the repr of two strings on each line for key/value pairs. To read it just evals each line in the string. And whichdb detects this format by looking for ' or as the first

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-07 Thread Barry A. Warsaw
Changes by Barry A. Warsaw [EMAIL PROTECTED]: -- priority: deferred blocker - release blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-05 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: The patch causes three errors: == ERROR: test_anydbm_access (test.test_dbm.TestCase-dbm.dumb) --

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-05 Thread Barry A. Warsaw
Barry A. Warsaw [EMAIL PROTECTED] added the comment: I don't see enough progress on this issue, and I'm not going to hold up 3.0rc2 for it, so I'm deferring. -- nosy: +barry priority: release blocker - deferred blocker ___ Python tracker [EMAIL

[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-05 Thread Skip Montanaro
Changes by Skip Montanaro [EMAIL PROTECTED]: -- nosy: -skip.montanaro ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___ ___ Python-bugs-list

[issue3799] Byte/string inconsistencies between different dbm modules

2008-10-10 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: For information, Python3 trunk fails on: test.support.TestFailed: Traceback (most recent call last): File Lib/test/test_dbm.py, line 157, in test_keys self.assert_('xxx' not in self.d) TypeError: gdbm key must be bytes, not str

[issue3799] Byte/string inconsistencies between different dbm modules

2008-10-02 Thread Barry A. Warsaw
Changes by Barry A. Warsaw [EMAIL PROTECTED]: -- priority: deferred blocker - release blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-10-02 Thread Jesús Cea Avión
Changes by Jesús Cea Avión [EMAIL PROTECTED]: -- nosy: +jcea ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___ ___ Python-bugs-list mailing list

[issue3799] Byte/string inconsistencies between different dbm modules

2008-10-02 Thread Benoit Boissinot
Changes by Benoit Boissinot [EMAIL PROTECTED]: -- nosy: +bboissin ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___ ___ Python-bugs-list mailing

[issue3799] Byte/string inconsistencies between different dbm modules

2008-10-02 Thread Benoit Boissinot
Changes by Benoit Boissinot [EMAIL PROTECTED]: ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue3799] Byte/string inconsistencies between different dbm modules

2008-10-02 Thread Benoit Boissinot
Changes by Benoit Boissinot [EMAIL PROTECTED]: -- nosy: -bboissin ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___ ___ Python-bugs-list mailing

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-26 Thread Barry A. Warsaw
Changes by Barry A. Warsaw [EMAIL PROTECTED]: -- priority: release blocker - deferred blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-17 Thread Barry A. Warsaw
Changes by Barry A. Warsaw [EMAIL PROTECTED]: -- priority: deferred blocker - release blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-10 Thread Guido van Rossum
Guido van Rossum [EMAIL PROTECTED] added the comment: I think this isn't quite right. Ideally a fix should maintain several important properties: (1) Be able to read databases written by Python 2.x. (1a) Write databases readable by Python 2.x. (2) Use the same mapping between str and bytes

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-09 Thread Barry A. Warsaw
Changes by Barry A. Warsaw [EMAIL PROTECTED]: -- priority: release blocker - deferred blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-07 Thread Guido van Rossum
Guido van Rossum [EMAIL PROTECTED] added the comment: Making this into a release blocker just so someone will look at it. Needs to be decided fixed by rc2 at the very latest. -- nosy: +gvanrossum priority: high - release blocker ___ Python tracker

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-07 Thread Skip Montanaro
Skip Montanaro [EMAIL PROTECTED] added the comment: Extra data point. I tried f[1] = a and f[b1] = a with dbm.{gnu,ndbm,dumb,sqlite}. All worked with bytes. A except dbm.dumb worked with strings. (dbm.sqlite is my little proof-of-concept module currently in the sandbox.)

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-07 Thread Guido van Rossum
Guido van Rossum [EMAIL PROTECTED] added the comment: How hard would it be to fix dbm.dumb to accept strings as well? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3799 ___

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-07 Thread Skip Montanaro
Skip Montanaro [EMAIL PROTECTED] added the comment: I'm not sure. I've never done anything with the io module. Simply eliminating the bytes checks and letting it try to write the string yields: File /Users/skip/local/lib/python3.0/dbm/dumb.py, line 170, in __setitem__ self._addkey(key,

[issue3799] Byte/string inconsistencies between different dbm modules

2008-09-06 Thread Skip Montanaro
New submission from Skip Montanaro [EMAIL PROTECTED]: Consider these two timeit commands: py3k% python3.0 -m timeit -s 'import dbm.ndbm as db' -s 'f = db.open(/tmp/trash.db, c)' 'for i in range(1000): f[str(i)] = str(i)' 100 loops, best of 3: 5.51 msec per loop py3k% python3.0 -m timeit -s