Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
372b583a
Kaydet (Commit)
372b583a
authored
Haz 05, 2006
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* fix DBCursor.pget() bug with keyword argument names when no data= is
supplied [SF pybsddb bug #1477863]
üst
1cb75a5e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
5 deletions
+76
-5
test_all.py
Lib/bsddb/test/test_all.py
+1
-0
test_cursor_pget_bug.py
Lib/bsddb/test/test_cursor_pget_bug.py
+65
-0
test_bsddb3.py
Lib/test/test_bsddb3.py
+1
-0
NEWS
Misc/NEWS
+5
-1
_bsddb.c
Modules/_bsddb.c
+4
-4
No files found.
Lib/bsddb/test/test_all.py
Dosyayı görüntüle @
372b583a
...
...
@@ -70,6 +70,7 @@ def suite():
'test_recno'
,
'test_thread'
,
'test_sequence'
,
'test_cursor_pget_bug'
,
]
alltests
=
unittest
.
TestSuite
()
...
...
Lib/bsddb/test/test_cursor_pget_bug.py
0 → 100644
Dosyayı görüntüle @
372b583a
import
unittest
import
sys
,
os
,
glob
try
:
# For Pythons w/distutils pybsddb
from
bsddb3
import
db
except
ImportError
:
# For Python 2.3
from
bsddb
import
db
#----------------------------------------------------------------------
class
pget_bugTestCase
(
unittest
.
TestCase
):
"""Verify that cursor.pget works properly"""
db_name
=
'test-cursor_pget.db'
def
setUp
(
self
):
self
.
homeDir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
'db_home'
)
try
:
os
.
mkdir
(
self
.
homeDir
)
except
os
.
error
:
pass
self
.
env
=
db
.
DBEnv
()
self
.
env
.
open
(
self
.
homeDir
,
db
.
DB_CREATE
|
db
.
DB_INIT_MPOOL
)
self
.
primary_db
=
db
.
DB
(
self
.
env
)
self
.
primary_db
.
open
(
self
.
db_name
,
'primary'
,
db
.
DB_BTREE
,
db
.
DB_CREATE
)
self
.
secondary_db
=
db
.
DB
(
self
.
env
)
self
.
secondary_db
.
set_flags
(
db
.
DB_DUP
)
self
.
secondary_db
.
open
(
self
.
db_name
,
'secondary'
,
db
.
DB_BTREE
,
db
.
DB_CREATE
)
self
.
primary_db
.
associate
(
self
.
secondary_db
,
lambda
key
,
data
:
data
)
self
.
primary_db
.
put
(
'salad'
,
'eggs'
)
self
.
primary_db
.
put
(
'spam'
,
'ham'
)
self
.
primary_db
.
put
(
'omelet'
,
'eggs'
)
def
tearDown
(
self
):
self
.
secondary_db
.
close
()
self
.
primary_db
.
close
()
self
.
env
.
close
()
del
self
.
secondary_db
del
self
.
primary_db
del
self
.
env
for
file
in
glob
.
glob
(
os
.
path
.
join
(
self
.
homeDir
,
'*'
)):
os
.
remove
(
file
)
os
.
removedirs
(
self
.
homeDir
)
def
test_pget
(
self
):
cursor
=
self
.
secondary_db
.
cursor
()
self
.
assertEquals
((
'eggs'
,
'salad'
,
'eggs'
),
cursor
.
pget
(
key
=
'eggs'
,
flags
=
db
.
DB_SET
))
self
.
assertEquals
((
'eggs'
,
'omelet'
,
'eggs'
),
cursor
.
pget
(
db
.
DB_NEXT_DUP
))
self
.
assertEquals
(
None
,
cursor
.
pget
(
db
.
DB_NEXT_DUP
))
self
.
assertEquals
((
'ham'
,
'spam'
,
'ham'
),
cursor
.
pget
(
'ham'
,
'spam'
,
flags
=
db
.
DB_SET
))
self
.
assertEquals
(
None
,
cursor
.
pget
(
db
.
DB_NEXT_DUP
))
cursor
.
close
()
def
test_suite
():
return
unittest
.
makeSuite
(
pget_bugTestCase
)
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
Lib/test/test_bsddb3.py
Dosyayı görüntüle @
372b583a
...
...
@@ -45,6 +45,7 @@ def suite():
'test_recno'
,
'test_thread'
,
'test_sequence'
,
'test_cursor_pget_bug'
,
]
alltests
=
unittest
.
TestSuite
()
...
...
Misc/NEWS
Dosyayı görüntüle @
372b583a
...
...
@@ -109,9 +109,13 @@ Extension Modules
assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF
patch numbers 1494885 and 1494902]
- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class
- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class
.
[pybsddb project SF patch number 1466734]
- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
parameter is supplied. [SF pybsddb bug #1477863]
Library
-------
...
...
Modules/_bsddb.c
Dosyayı görüntüle @
372b583a
...
...
@@ -98,7 +98,7 @@
#error "eek! DBVER can't handle minor versions > 9"
#endif
#define PY_BSDDB_VERSION "4.4.
2
"
#define PY_BSDDB_VERSION "4.4.
4
"
static
char
*
rcs_id
=
"$Id$"
;
...
...
@@ -3194,8 +3194,8 @@ DBC_pget(DBCursorObject* self, PyObject* args, PyObject *kwargs)
int
dlen
=
-
1
;
int
doff
=
-
1
;
DBT
key
,
pkey
,
data
;
static
char
*
kwnames
[]
=
{
"key"
,
"data"
,
"flags"
,
"dlen"
,
"doff"
,
NULL
};
static
char
*
kwnames
_keyOnly
[]
=
{
"key"
,
"flags"
,
"dlen"
,
"doff"
,
NULL
};
static
char
*
kwnames
[]
=
{
"key"
,
"data"
,
"flags"
,
"dlen"
,
"doff"
,
NULL
};
CLEAR_DBT
(
key
);
CLEAR_DBT
(
data
);
...
...
@@ -3204,7 +3204,7 @@ DBC_pget(DBCursorObject* self, PyObject* args, PyObject *kwargs)
{
PyErr_Clear
();
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"Oi|ii:pget"
,
&
kwnames
[
1
]
,
kwnames_keyOnly
,
&
keyobj
,
&
flags
,
&
dlen
,
&
doff
))
{
PyErr_Clear
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment