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
9f96789c
Kaydet (Commit)
9f96789c
authored
Tem 07, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
#17198: merge with 3.3.
üst
74a146d3
b08495bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
__init__.py
Lib/dbm/__init__.py
+5
-0
test_dbm.py
Lib/test/test_dbm.py
+16
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/dbm/__init__.py
Dosyayı görüntüle @
9f96789c
...
@@ -44,6 +44,11 @@ _modules = {}
...
@@ -44,6 +44,11 @@ _modules = {}
error
=
(
error
,
OSError
)
error
=
(
error
,
OSError
)
try
:
from
dbm
import
ndbm
except
ImportError
:
ndbm
=
None
def
open
(
file
,
flag
=
'r'
,
mode
=
0
o666
):
def
open
(
file
,
flag
=
'r'
,
mode
=
0
o666
):
"""Open or create database at path given by *file*.
"""Open or create database at path given by *file*.
...
...
Lib/test/test_dbm.py
Dosyayı görüntüle @
9f96789c
...
@@ -9,6 +9,11 @@ import test.support
...
@@ -9,6 +9,11 @@ import test.support
# Skip tests if dbm module doesn't exist.
# Skip tests if dbm module doesn't exist.
dbm
=
test
.
support
.
import_module
(
'dbm'
)
dbm
=
test
.
support
.
import_module
(
'dbm'
)
try
:
from
dbm
import
ndbm
except
ImportError
:
ndbm
=
None
_fname
=
test
.
support
.
TESTFN
_fname
=
test
.
support
.
TESTFN
#
#
...
@@ -130,7 +135,7 @@ class WhichDBTestCase(unittest.TestCase):
...
@@ -130,7 +135,7 @@ class WhichDBTestCase(unittest.TestCase):
delete_files
()
delete_files
()
f
=
module
.
open
(
_fname
,
'c'
)
f
=
module
.
open
(
_fname
,
'c'
)
f
.
close
()
f
.
close
()
self
.
assertEqual
(
name
,
dbm
.
whichdb
(
_fname
))
self
.
assertEqual
(
name
,
self
.
dbm
.
whichdb
(
_fname
))
# Now add a key
# Now add a key
f
=
module
.
open
(
_fname
,
'w'
)
f
=
module
.
open
(
_fname
,
'w'
)
f
[
b
"1"
]
=
b
"1"
f
[
b
"1"
]
=
b
"1"
...
@@ -139,7 +144,15 @@ class WhichDBTestCase(unittest.TestCase):
...
@@ -139,7 +144,15 @@ class WhichDBTestCase(unittest.TestCase):
# and read it
# and read it
self
.
assertTrue
(
f
[
b
"1"
]
==
b
"1"
)
self
.
assertTrue
(
f
[
b
"1"
]
==
b
"1"
)
f
.
close
()
f
.
close
()
self
.
assertEqual
(
name
,
dbm
.
whichdb
(
_fname
))
self
.
assertEqual
(
name
,
self
.
dbm
.
whichdb
(
_fname
))
@unittest.skipUnless
(
ndbm
,
reason
=
'Test requires ndbm'
)
def
test_whichdb_ndbm
(
self
):
# Issue 17198: check that ndbm which is referenced in whichdb is defined
db_file
=
'{}_ndbm.db'
.
format
(
_fname
)
with
open
(
db_file
,
'w'
):
self
.
addCleanup
(
test
.
support
.
unlink
,
db_file
)
self
.
assertIsNone
(
self
.
dbm
.
whichdb
(
db_file
[:
-
3
]))
def
tearDown
(
self
):
def
tearDown
(
self
):
delete_files
()
delete_files
()
...
@@ -149,6 +162,7 @@ class WhichDBTestCase(unittest.TestCase):
...
@@ -149,6 +162,7 @@ class WhichDBTestCase(unittest.TestCase):
self
.
filename
=
test
.
support
.
TESTFN
self
.
filename
=
test
.
support
.
TESTFN
self
.
d
=
dbm
.
open
(
self
.
filename
,
'c'
)
self
.
d
=
dbm
.
open
(
self
.
filename
,
'c'
)
self
.
d
.
close
()
self
.
d
.
close
()
self
.
dbm
=
test
.
support
.
import_fresh_module
(
'dbm'
)
def
test_keys
(
self
):
def
test_keys
(
self
):
self
.
d
=
dbm
.
open
(
self
.
filename
,
'c'
)
self
.
d
=
dbm
.
open
(
self
.
filename
,
'c'
)
...
...
Misc/NEWS
Dosyayı görüntüle @
9f96789c
...
@@ -142,6 +142,9 @@ Core and Builtins
...
@@ -142,6 +142,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
17198
:
Fix
a
NameError
in
the
dbm
module
.
Patch
by
Valentina
Mukhamedzhanova
.
-
Issue
#
18013
:
Fix
cgi
.
FieldStorage
to
parse
the
W3C
sample
form
.
-
Issue
#
18013
:
Fix
cgi
.
FieldStorage
to
parse
the
W3C
sample
form
.
-
Issue
#
18020
:
improve
html
.
escape
speed
by
an
order
of
magnitude
.
-
Issue
#
18020
:
improve
html
.
escape
speed
by
an
order
of
magnitude
.
...
...
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