This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年05月07日 15:30 by David.Edelsohn, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (8) | |||
|---|---|---|---|
| msg188666 - (view) | Author: David Edelsohn (David.Edelsohn) * | Date: 2013年05月07日 15:30 | |
The PowerLinux buildslave fails in test_dbm:test_keys() because of a problem with the "in" operator.
>>> import dbm
>>> d = dbm.open('t','c')
>>> a = [('a', 'b'), ('12345678910', '019237410982340912840198242')]
>>> for k,v in a:
... d[k] = v
...
>>> print d
<dbm.dbm object at 0x3fff93073110>
>>> print d.keys()
['a', '12345678910']
>>> print 'a' in d
False <--- This apparently should be True
>>> print 'a' in d.keys()
True
|
|||
| msg188669 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年05月07日 15:51 | |
Can you try the other dbm methods? e.g. has_key(), get()... |
|||
| msg188671 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年05月07日 15:59 | |
Forget it, can you just try the following patch?
diff --git a/Modules/dbmmodule.c b/Modules/dbmmodule.c
--- a/Modules/dbmmodule.c
+++ b/Modules/dbmmodule.c
@@ -168,11 +168,13 @@
dbm_contains(register dbmobject *dp, PyObject *v)
{
datum key, val;
+ char *ptr;
+ Py_ssize_t size;
- if (PyString_AsStringAndSize(v, (char **)&key.dptr,
- (Py_ssize_t *)&key.dsize)) {
+ if (PyString_AsStringAndSize(v, &ptr, &size))
return -1;
- }
+ key.dptr = ptr;
+ key.dsize = size;
/* Expand check_dbmobject_open to return -1 */
if (dp->di_dbm == NULL) {
|
|||
| msg188674 - (view) | Author: David Edelsohn (David.Edelsohn) * | Date: 2013年05月07日 16:14 | |
My example and test_dbm succeeds on Python2.7 with your patch applied. Thanks! |
|||
| msg188675 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年05月07日 16:20 | |
Ok. This is a classic example of why a big-endian buildbot is useful :) |
|||
| msg188693 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年05月07日 23:51 | |
New changeset 53da3bad8554 by Antoine Pitrou in branch '2.7': Issue #17926: Fix dbm.__contains__ on 64-bit big-endian machines. http://hg.python.org/cpython/rev/53da3bad8554 |
|||
| msg188694 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年05月07日 23:52 | |
Committed, thank you. |
|||
| msg188824 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2013年05月10日 09:44 | |
See also issue9687. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:45 | admin | set | github: 62126 |
| 2013年05月10日 10:09:13 | pitrou | link | issue9687 superseder |
| 2013年05月10日 09:44:46 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg188824 |
| 2013年05月07日 23:52:12 | pitrou | set | status: open -> closed resolution: fixed messages: + msg188694 stage: commit review -> resolved |
| 2013年05月07日 23:51:46 | python-dev | set | nosy:
+ python-dev messages: + msg188693 |
| 2013年05月07日 16:20:22 | pitrou | set | messages:
+ msg188675 stage: commit review |
| 2013年05月07日 16:14:38 | David.Edelsohn | set | messages: + msg188674 |
| 2013年05月07日 15:59:57 | pitrou | set | messages: + msg188671 |
| 2013年05月07日 15:51:26 | pitrou | set | messages: + msg188669 |
| 2013年05月07日 15:31:55 | David.Edelsohn | set | type: behavior |
| 2013年05月07日 15:31:28 | David.Edelsohn | set | nosy:
+ pitrou |
| 2013年05月07日 15:30:25 | David.Edelsohn | create | |