summaryrefslogtreecommitdiffstats
path: root/Modules/_dbmmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* GH-46412: More efficient bool() for ndbm/_gdbmmodule (#96692)Guido van Rossum2022-09-091-0/+32
|
* gh-89452: Prefer gdbm-compat over ndbm (#92208)Łukasz Langa2022-05-031-4/+4
| | | | | This makes macOS gdbm provided by Homebrew not segfault through correct selection of the linked library (-lgdbm_compat) *AND* the correct ndbm-style header (gdbm-ndbm.h instead of the invalid ndbm.h).
* 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-45747: Detect gdbm/dbm dependencies in configure (GH-29467)Christian Heimes2021-11-101-13/+19
| | | Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* 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-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-5/+15
| | | | | | | 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-5/+4
|
* 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 _dbm module to multiphase initialization (GH-20848)Dong-hee Na2020-06-151-132/+170
|
* 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-33106: change dbm key deletion error for readonly file from KeyError to ↵Xiang Zhang2018-12-121-3/+12
| | | | | | dbm.error (#6295)
* 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.
* bpo-33383: Fix crash in get() of the dbm.ndbm database object. (#6630)Serhiy Storchaka2018-04-291-2/+2
|
* 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-2/+1
| | | | 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-2/+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-2/+2
| | | | | | | | generated by Argument Clinic. Patch by Petr Viktorin.
* | Issue #25923: Added the const qualifier to static constant arrays.Serhiy Storchaka2015-12-251-4/+4
|/
* Issue #24000: Improved Argument Clinic's mapping of converters to legacyLarry Hastings2015-05-081-4/+5
| | | | "format units". Updated the documentation to match.
* Issue #24001: Argument Clinic converters now use accept={type}Larry Hastings2015-05-041-4/+4
| | | | 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-61/+67
|
* Issue #23935: Argument Clinic's understanding of format unitsLarry Hastings2015-04-161-2/+2
| | | | | accepting bytes, bytearrays, and buffers is now consistent with both the documentation and the implementation.
* Issue #23944: Argument Clinic now wraps long impl prototypes at column 78.Larry Hastings2015-04-141-4/+6
|
* Issue #23501: Argumen Clinic now generates code into separate files by default.Serhiy Storchaka2015-04-031-70/+4
|
* Issue #20530: Argument Clinic's signature format has been revised again.Larry Hastings2014-02-091-4/+8
| | | | | | | The new syntax is highly human readable while still preventing false positives. The syntax also extends Python syntax to denote "self" and positional-only parameters, allowing inspect.Signature objects to be totally accurate for all supported builtins in Python 3.4.
* #Issue 20456: Several improvements and bugfixes for Argument Clinic,Larry Hastings2014-02-011-29/+15
| | | | | including correctly generating code for Clinic blocks inside C preprocessor conditional blocks.
* Issue #20326: Argument Clinic now uses a simple, unique signature toLarry Hastings2014-01-281-5/+5
| | | | | | | | | | annotate text signatures in docstrings, resulting in fewer false positives. "self" parameters are also explicitly marked, allowing inspect.Signature() to authoritatively detect (and skip) said parameters. Issue #20326: Argument Clinic now generates separate checksums for the input and output sections of the block, allowing external tools to verify that the input has not changed (and thus the output is not out-of-date).
* Issue #20390: Small fixes and improvements for Argument Clinic.Larry Hastings2014-01-261-1/+1
|
* Issue #20189: Four additional builtin types (PyTypeObject,Larry Hastings2014-01-241-6/+6
| | | | | | PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type) have been modified to provide introspection information for builtins. Also: many additional Lib, test suite, and Argument Clinic fixes.
* Two minor Argument Clinic bugfixes: use the name of the class in theLarry Hastings2014-01-221-4/+5
| | | | | docstring for __new__ and __init__, and always use "goto exit" instead of returning "NULL" for failure to parse (as _new__ and __init__ return ints).
* Issue #20226: Major improvements to Argument Clinic.Larry Hastings2014-01-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | * You may now specify an expression as the default value for a parameter! Example: "sys.maxsize - 1". This support is intentionally quite limited; you may only use values that can be represented as static C values. * Removed "doc_default", simplified support for "c_default" and "py_default". (I'm not sure we still even need "py_default", but I'm leaving it in for now in case a use presents itself.) * Parameter lines support a trailing '\\' as a line continuation character, allowing you to break up long lines. * The argument parsing code generated when supporting optional groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize, leading to a 850% speedup in parsing. (Just kidding, this is an unmeasurable difference.) * A bugfix for the recent regression where the generated prototype from pydoc for builtins would be littered with unreadable "=<object ...>"" default values for parameters that had no default value. * Converted some asserts into proper failure messages. * Many doc improvements and fixes.
* Issue #19273: The marker comments Argument Clinic uses have been changedLarry Hastings2014-01-071-12/+12
| | | | to improve readability.
* Issue #19296: Silence compiler warning in dbm_open.Christian Heimes2013-12-051-1/+2
| | | | Some dbm header files declare the first argument as char * instead of a const char *.
* Issue #19674: inspect.signature() now produces a correct signatureLarry Hastings2013-11-231-12/+11
| | | | for some builtins.
* Issue #19730: Argument Clinic now supports all the existing PyArgLarry Hastings2013-11-231-23/+84
| | | | | "format units" as legacy converters, as well as two new features: "self converters" and the "version" directive.
* Argument Clinic: rename "self" to "module" for module-level functions.Larry Hastings2013-11-181-5/+5
|
* Close #19282: Native context management in dbmNick Coghlan2013-11-171-0/+17
|
* Issue #19287: Fixed the "in" operator of dbm.ndbm databases for stringSerhiy Storchaka2013-10-241-2/+2
|\ | | | | | | argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
| * Issue #19287: Fixed the "in" operator of dbm.ndbm databases for stringSerhiy Storchaka2013-10-241-2/+2
| | | | | | | | argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
* | Issue #16612: Add "Argument Clinic", a compile-time preprocessorLarry Hastings2013-10-191-10/+61
| | | | | | | | for C files to generate argument parsing code. (See PEP 436.)
* | Issue #18722: Remove uses of the "register" keyword in C code.Antoine Pitrou2013-08-131-7/+7
| |
* | #16135: Removal of OS/2 support (Modules/*)Jesus Cea2012-10-051-4/+0
|/
* Implement PEP 393.Martin v. Löwis2011-09-281-4/+8
|