Commit Graph

29 Commits

Author SHA1 Message Date
Guido van Rossum df50938f58
GH-46412: More efficient bool() for ndbm/_gdbmmodule (#96692) 2022-09-08 19:32:40 -07:00
Henry-Joseph Audéoud 707137b863
bpo-40563: Support pathlike objects on dbm/shelve (GH-21849)
Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
2021-09-10 15:26:16 +03:00
Erlend Egeberg Aasland fbff5387c3
bpo-43988: Use check disallow instantiation helper (GH-26392) 2021-05-27 08:43:52 +02:00
Erlend Egeberg Aasland 9746cda705
bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)
Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to the following types:

* _dbm.dbm
* _gdbm.gdbm
* _multibytecodec.MultibyteCodec
* _sre..SRE_Scanner
* _thread._localdummy
* _thread.lock
* _winapi.Overlapped
* array.arrayiterator
* functools.KeyWrapper
* functools._lru_list_elem
* pyexpat.xmlparser
* re.Match
* re.Pattern
* unicodedata.UCD
* zlib.Compress
* zlib.Decompress
2021-04-30 16:04:57 +02:00
Hai Shi 79bb2c93f2
bpo-40275: Use new test.support helper submodules in tests (GH-21743) 2020-08-06 13:51:29 +02:00
Hai Shi deb016224c
bpo-40275: Use new test.support helper submodules in tests (GH-21317) 2020-07-06 14:29:49 +02:00
Xiang Zhang 4fb0b8bc25
bpo-33106: change dbm key deletion error for readonly file from KeyError to dbm.error (#6295) 2018-12-12 20:46:55 +08:00
Zsolt Cserna 9df346bf98 bpo-34248: Add filename to error raised in {gnu,ndbm}.open() (GH-8590)
Report the filename to the exception when raising {gdbm,dbm.ndbm}.error in
dbm.gnu.open() and dbm.ndbm.open() functions, so it gets printed when the
exception is raised, and can also be obtained by the filename attribute of the
exception object.
2018-09-27 22:54:34 +03:00
Xiang Zhang b248e957a8
Fix compiling error when missing gdbm version macros (GH-7823) 2018-06-20 21:23:30 +08:00
Victor Stinner 00f9edb98d
bpo-33901: Add _gdbm._GDBM_VERSION (GH-7794)
* Fix also PyInit__gdbm() to catch errors.
* test.pythoninfo: add gdbm.version
* test_dbm_gnu now logs GDBM_VERSION when run in verbose mode.

* pythoninfo: rename function to collect_gdbm()
2018-06-19 23:29:22 +02:00
Victor Stinner c44d8e5db6
bpo-33901: Better test_dbm_gnu.test_reorganize() fix (GH-7795)
Fix test_dbm_gnu.test_reorganize() on macOS with gdbm 1.15: add a
larger value to make sure that the file size changes.
2018-06-19 17:37:07 +02:00
Victor Stinner 1261bfa83d
bpo-33901: Fix test_dbm_gnu for gdbm 1.15 (GH-7791)
Using gdbm 1.15, creating a database creates a file of 16 MiB. Adding
a small entry and then modifying the small entry doesn't change the
file size. Modify test_dbm_gnu to be less strict: allow that the file
size doesn't change.
2018-06-19 14:19:54 +02:00
Serhiy Storchaka 22525de737
Use more specific asserts in dbm tests. (GH-7786)
This may help to investigate bpo-33901.
2018-06-19 13:31:48 +03:00
Serhiy Storchaka 2e38cc3933
bpo-33383: Fix crash in get() of the dbm.ndbm database object. (#6630) 2018-04-29 12:38:06 +03:00
Serhiy Storchaka 6f600ff173
bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832) 2018-02-26 16:02:22 +02:00
Serhiy Storchaka e437a10d15 Issue #23277: Remove unused imports in tests. 2016-04-24 21:41:02 +03:00
doko@ubuntu.com a938bcfe95 - Remove execute permissions from test_dbm_gnu.py and test_dbm_ndbm.py 2013-11-19 09:12:50 +01:00
doko@ubuntu.com 7ad11bf815 - Remove execute permissions from test_dbm_gnu.py and test_dbm_ndbm.py 2013-11-19 09:12:28 +01:00
Nick Coghlan c610aba1ed Close #19282: Native context management in dbm 2013-11-17 15:59:51 +10:00
Serhiy Storchaka 7d6392c517 Issue #19288: Fixed the "in" operator of dbm.gnu databases for string
argument.  Original patch by Arfrever Frehtes Taifersar Arahesis.
2013-10-25 00:06:52 +03:00
Ezio Melotti f79493bf9e #17082: test_dbm* now work with unittest test discovery. Patch by Zachary Ware. 2013-03-01 11:23:28 +02:00
Georg Brandl 16684eb624 Fix dbm_gnu test relying on set order. 2012-02-20 22:48:06 +01:00
Georg Brandl d9e833c70a #6045: provide at least get() and setdefault() for all dbm modules. 2010-12-04 09:14:36 +00:00
Benjamin Peterson 577473fe68 use assert[Not]In where appropriate
A patch from Dave Malcolm.
2010-01-19 00:09:57 +00:00
Benjamin Peterson c9c0f201fe convert old fail* assertions to assert* 2009-06-30 23:06:06 +00:00
Kristján Valur Jónsson 42a40c59a0 Allow skipping of regression tests not supported on windows. This reduces noise in the regression test suite for py3k on Windows. 2009-04-01 11:28:47 +00:00
Brett Cannon 45dea65b39 Fix a broken test_dbm_gnu as introducted by r67380. 2008-11-25 21:27:00 +00:00
Brett Cannon 7317c1ef7a dbm.gnu and dbm.ndbm accept both strings and bytes as keys and values. For the
former they are converted to bytes before being written to the DB.

Closes issue 3799. Reviewed by Skip Montanaro.
2008-11-25 19:19:17 +00:00
Georg Brandl 0a7ac7d70d Create the dbm package from PEP 3108. #2881. 2008-05-26 10:29:35 +00:00