summaryrefslogtreecommitdiffstats
path: root/Modules/_gdbmmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* gh-99426: Use PyUnicode_FromFormat() and PyErr_Format() instead of sprintf ↵Serhiy Storchaka2022-11-141-4/+2
| | | | (GH-99427)
* gh-99300: Use Py_NewRef() in Modules/ directory (#99466)Victor Stinner2022-11-141-4/+2
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in test C files of the Modules/ directory.
* GH-46412: More efficient bool() for ndbm/_gdbmmodule (#96692)Guido van Rossum2022-09-091-0/+30
|
* bpo-46541: Remove usage of _Py_IDENTIFIER from dbms modules (GH-31358)Dong-hee Na2022-02-161-3/+1
|
* bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow2022-02-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | global objects. (gh-30928) We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code. It is still used in a number of non-builtin stdlib modules. The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime. A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings). https://bugs.python.org/issue46541#msg411799 explains the rationale for this change. The core of the change is in: * (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros * Include/internal/pycore_runtime_init.h - added the static initializers for the global strings * Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState * Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings. That check is added to the PR CI config. The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()). This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *. The following are not changed (yet): * stop using _Py_IDENTIFIER() in the stdlib modules * (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API * (maybe) intern the strings during runtime init https://bugs.python.org/issue46541
* bpo-45434: pyport.h no longer includes <stdlib.h> (GH-28914)Victor Stinner2021-10-131-3/+4
| | | | | Include <stdlib.h> explicitly in C files. Python.h includes <wchar.h>.
* bpo-40563: Support pathlike objects on dbm/shelve (GH-21849)Henry-Joseph Audéoud2021-09-101-4/+5
| | | | Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
* bpo-45060: Get rid of few uses of the equality operators with None (GH-28087)Serhiy Storchaka2021-08-311-2/+2
|
* bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)Erlend Egeberg Aasland2021-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make functools types immutable * Multibyte codec types are now immutable * pyexpat.xmlparser is now immutable * array.arrayiterator is now immutable * _thread types are now immutable * _csv types are now immutable * _queue.SimpleQueue is now immutable * mmap.mmap is now immutable * unicodedata.UCD is now immutable * sqlite3 types are now immutable * _lsprof.Profiler is now immutable * _overlapped.Overlapped is now immutable * _operator types are now immutable * winapi__overlapped.Overlapped is now immutable * _lzma types are now immutable * _bz2 types are now immutable * _dbm.dbm and _gdbm.gdbm are now immutable
* bpo-42972: Fully support GC for pyexpat, unicodedata, and dbm/gdbm heap ↵Erlend Egeberg Aasland2021-05-271-2/+13
| | | | | | | types (GH-26376) * bpo-42972: pyexpat * bpo-42972: unicodedata * bpo-42972: dbm/gdbm
* Do not use Py_ssize_clean_t (GH-25940)Inada Naoki2021-05-081-2/+2
|
* bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)Erlend Egeberg Aasland2021-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* bpo-1635741: Port _gdbm module to multiphase initialization (GH-20920)Dong-hee Na2020-06-161-169/+205
|
* bpo-32494: Use gdbm_count for dbm_length if possible (GH-19814)Dong-hee Na2020-05-011-5/+25
|
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-1/+1
|
* bpo-39573: Use Py_TYPE() macro in Modules directory (GH-18393)Victor Stinner2020-02-071-1/+1
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)Jeroen Demeyer2019-07-081-1/+1
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-8677: use PY_SSIZE_T_CLEAN in Modules/_gdbmodule.c (GH-12464)Inada Naoki2019-03-201-9/+27
|
* bpo-33106: change dbm key deletion error for readonly file from KeyError to ↵Xiang Zhang2018-12-121-2/+7
| | | | | | dbm.error (#6295)
* Remove a duplicate descriptor in gdbm. (GH-11053)Serhiy Storchaka2018-12-091-1/+0
|
* bpo-34248: Add filename to error raised in {gnu,ndbm}.open() (GH-8590)Zsolt Cserna2018-09-271-1/+1
| | | | | | 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.
* Fix compiling error when missing gdbm version macros (GH-7823)Xiang Zhang2018-06-201-0/+3
|
* bpo-33901: Add _gdbm._GDBM_VERSION (GH-7794)Victor Stinner2018-06-191-8/+31
| | | | | | | * 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()
* bpo-32922: dbm.open() now encodes filename with the filesystem encoding. ↵Serhiy Storchaka2018-02-261-4/+17
| | | | (GH-5832)
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-161-1/+1
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-10/+5
| | | | possible. Patch is writen with Coccinelle.
* Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()Serhiy Storchaka2017-01-221-1/+1
| | | | is now of type "const char *" rather of "char *".
* - Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-3/+2
|\ | | | | | | generated by Argument Clinic. Patch by Petr Viktorin.
| * Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-3/+2
| | | | | | | | generated by Argument Clinic. Patch by Petr Viktorin.
* | Issue #25923: Added the const qualifier to static constant arrays.Serhiy Storchaka2015-12-251-1/+1
|/
* Issue #24000: Improved Argument Clinic's mapping of converters to legacyLarry Hastings2015-05-081-2/+2
| | | | "format units". Updated the documentation to match.
* Issue #24001: Argument Clinic converters now use accept={type}Larry Hastings2015-05-041-2/+2
| | | | instead of types={'type'} to specify the types the converter accepts.
* Issue #20184: Converted _dbm and _gdbm modules to Argument Clinic.Serhiy Storchaka2015-04-171-129/+177
|
* Close #19282: Native context management in dbmNick Coghlan2013-11-171-0/+16
|
* Issue #19288: Fixed the "in" operator of dbm.gnu databases for stringSerhiy Storchaka2013-10-241-4/+13
|\ | | | | | | argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
| * Issue #19288: Fixed the "in" operator of dbm.gnu databases for stringSerhiy Storchaka2013-10-241-4/+13
| | | | | | | | argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
* | Issue #18722: Remove uses of the "register" keyword in C code.Antoine Pitrou2013-08-131-11/+11
|/
* #6045: provide at least get() and setdefault() for all dbm modules.Georg Brandl2010-12-041-0/+47
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-35/+35
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-1/+1
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.
* dbm.gnu and dbm.ndbm accept both strings and bytes as keys and values. For theBrett Cannon2008-11-251-2/+2
| | | | | | former they are converted to bytes before being written to the DB. Closes issue 3799. Reviewed by Skip Montanaro.
* #3247: get rid of Py_FindMethodAmaury Forgeot d'Arc2008-07-021-7/+8
| | | | Third step: unix-only modules. Really remove the function this time.
* Implement PEP 3121: new module initialization and finalization API.Martin v. Löwis2008-06-111-6/+18
|
* Make db modules' error classes inherit IOError.Georg Brandl2008-05-281-1/+1
| | | | Stop dbm from importing every dbm module when imported.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-7/+7
|
* Create the dbm package from PEP 3108. #2881.Georg Brandl2008-05-261-0/+533