Serhiy Storchaka
51ea664d18
gh-99593: Add tests for Unicode C API (part 3) (GH-104728)
...
Add tests for codecs.
2023-07-10 14:04:34 +03:00
littlebutt's workshop
d137c2cae2
gh-104469: Convert_testcapi/vectorcall.c to use AC (gh-106557)
2023-07-09 21:08:18 +09:00
Victor Stinner
8a73b57b9b
gh-106320: Remove _PyUnicode_TransformDecimalAndSpaceToASCII() ( #106398 )
...
Remove private _PyUnicode_TransformDecimalAndSpaceToASCII() and other
private _PyUnicode C API functions: move them to the internal C API
(pycore_unicodeobject.h). No longer most of these functions.
Replace _testcapi.unicode_transformdecimalandspacetoascii() with
_testinternal._PyUnicode_TransformDecimalAndSpaceToASCII().
2023-07-04 08:59:09 +00:00
Carl Meyer
58906213cc
gh-91053: make func watcher tests resilient to other func watchers ( #106286 )
2023-07-03 08:25:22 -06:00
Victor Stinner
4e3aa7cd31
gh-106320: _testcapi avoids private _PyUnicode_EqualToASCIIString() ( #106341 )
...
Replace private _PyUnicode_EqualToASCIIString() with public
PyUnicode_CompareWithASCIIString().
2023-07-02 21:56:58 +00:00
Inada Naoki
d5bd32fb48
gh-104922: remove PY_SSIZE_T_CLEAN ( #106315 )
2023-07-02 15:07:46 +09:00
Victor Stinner
feb51f3a64
gh-106320: Remove private _PyTraceMalloc C API functions ( #106324 )
...
* Remove private _PyTraceMalloc C API functions: move them to the
internal C API.
* Don't export most of these functions anymore, but still export
_PyTraceMalloc_GetTraceback() used by tests.
* Rename Include/tracemalloc.h to Include/cpython/tracemalloc.h
2023-07-02 00:49:18 +00:00
Victor Stinner
46d77610fc
gh-106316: Remove pytime.h header file ( #106317 )
...
Remove the "cpython/pytime.h" header file: it only contained private
functions. Move functions to the internal pycore_time.h header file.
Move tests from _testcapi to _testinternalcapi. Rename also test
methods to have the same name than tested C functions.
No longer export these functions:
* _PyTime_Add()
* _PyTime_As100Nanoseconds()
* _PyTime_FromMicrosecondsClamp()
* _PyTime_FromTimespec()
* _PyTime_FromTimeval()
* _PyTime_GetPerfCounterWithInfo()
* _PyTime_MulDiv()
2023-07-01 22:27:18 +00:00
Victor Stinner
2efdd2a14e
gh-106023: Remove _PyObject_FastCall() function ( #106265 )
2023-06-30 11:46:43 +02:00
Serhiy Storchaka
1d33d53780
gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034)
...
These functions are broken by design because they discard any exceptions raised
inside, including MemoryError and KeyboardInterrupt. They should not be
used in new code.
2023-06-23 20:10:32 +03:00
Petr Viktorin
2b90796be6
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)
2023-06-12 17:45:49 +02:00
Erlend E. Aasland
d636d7dfe7
gh-105375: Harden error handling in _testcapi/heaptype.c ( #105608 )
...
Bail on first error in heapctypesubclasswithfinalizer_finalize()
2023-06-09 21:53:33 +00:00
Victor Stinner
8ed705c083
gh-105156: Deprecate the old Py_UNICODE type in C API ( #105157 )
...
Deprecate the old Py_UNICODE and PY_UNICODE_TYPE types in the C API:
use wchar_t instead.
Replace Py_UNICODE with wchar_t in multiple C files.
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2023-06-01 08:56:35 +02:00
Inada Naoki
adccff3b3f
gh-104922: Make PY_SSIZE_T_CLEAN not mandatory again ( #105051 )
2023-05-31 18:38:55 +09:00
Irit Katriel
b7aadb4583
gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API ( #105072 )
2023-05-30 15:03:36 +01:00
Dong-hee Na
76170f5458
gh-104469: Convert _testcapi/long to use AC (gh-104720)
2023-05-23 22:52:36 +09:00
Serhiy Storchaka
f3466bc040
gh-98836: Extend PyUnicode_FromFormat() (GH-98838)
...
* Support for conversion specifiers o (octal) and X (uppercase hexadecimal).
* Support for length modifiers j (intmax_t) and t (ptrdiff_t).
* Length modifiers are now applied to all integer conversions.
* Support for wchar_t C strings (%ls and %lV).
* Support for variable width and precision (*).
* Support for flag - (left alignment).
2023-05-22 00:32:39 +03:00
Mark Shannon
93923793f6
GH-101291: Add low level, unstable API for pylong (GH-101685)
...
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-05-21 14:45:48 +01:00
Dong-hee Na
2e91c7e626
gh-104469: Convert _testcapi/exceptions to use AC (gh-104502)
2023-05-21 18:39:45 +09:00
Dong-hee Na
b58bc8c2a9
gh-104469: Update README.txt for _testcapi (gh-104529)
...
* gh-104469: Update README.txt for _testcapi
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-05-17 12:56:20 +09:00
Nikita Sobolev
456d56698d
gh-104469: Convert _testcapi/watchers.c to use Argument Clinic ( #104503 )
...
Remove boilerplate code by converting the following functions:
- _testcapi.watch_dict
- _testcapi.unwatch_dict
- _testcapi.watch_type
- _testcapi.unwatch_type
- _testcapi.set_func_defaults_via_capi
- _testcapi.set_func_kwdefaults_via_capi
2023-05-15 22:59:41 +02:00
Dong-hee Na
48b3617de4
gh-104469 Convert _testcapi/float.c to use AC (gh-104470)
2023-05-15 12:44:00 +09:00
Jurica Bradarić
19ee53d52e
gh-93649: Split gc- and allocation tests from _testcapimodule.c (GH-104403)
2023-05-12 10:26:07 +01:00
Hugo van Kemenade
d513ddee94
Trim trailing whitespace and test on CI ( #104275 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-08 17:03:52 +03:00
Serhiy Storchaka
2ba931ff72
gh-99593: Add tests for Unicode C API (part 2) ( #99868 )
...
Add tests for lower-level functions.
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-04 15:25:09 +00:00
Jelle Zijlstra
04f6733275
gh-102500: Implement PEP 688 ( #102521 )
...
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-05-04 07:59:46 -07:00
Petr Viktorin
cd9a56c2b0
gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)
...
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-04 09:56:53 +02:00
Petr Viktorin
524a7f77fd
gh-103968: Deprecate creating heap types whose metaclass has custom tp_new. (GH-103972)
...
(That's a mouthful of an edge case!)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2023-05-03 15:17:14 +02:00
Dong-hee Na
d81ca7ec02
gh-84436: Add integration C API tests for immortal objects (gh-103962)
2023-05-03 00:05:30 +09:00
Liyang Zhang
11ed70b1dc
Fix typos in faulthandler, testcapi error messages ( #103020 )
2023-03-25 14:27:02 -07:00
Mark Shannon
7559f5fda9
GH-101291: Rearrange the size bits in PyLongObject (GH-102464)
...
* Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject, adding asserts.
* Change layout of size/sign bits in longobject to support future addition of immortal ints and tagged medium ints.
* Add functions to hide some internals of long object, and for setting sign and digit count.
* Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsCompact().
2023-03-22 14:49:51 +00:00
Artem Mukhin
0a60deaeaf
GH-94808: Cover PyOS_mystrnicmp and PyOS_mystricmp (gh-102469)
2023-03-22 20:35:27 +09:00
Irit Katriel
5c471f3f2a
gh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover PyErr_Display as well (GH-102849)
2023-03-21 10:36:18 +01:00
Irit Katriel
3f9285a8c5
gh-102755: Add PyErr_DisplayException(exc) ( #102756 )
2023-03-16 22:18:04 +00:00
Irit Katriel
51d693c584
gh-102594: PyErr_SetObject adds note to exception raised on normalization error ( #102675 )
2023-03-16 10:16:01 +00:00
Carl Meyer
1e703a4733
gh-102381: don't call watcher callback with dead object ( #102382 )
...
Co-authored-by: T. Wouters <thomas@python.org>
2023-03-07 17:10:58 -07:00
Irit Katriel
a33ca2ad1f
gh-102493: fix normalization in PyErr_SetObject ( #102502 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-03-07 13:27:46 -08:00
Dong-hee Na
ed55c69ebd
gh-101101: Fix test_code_extra to reset value for refleak test (gh-102350)
2023-03-02 20:32:05 +09:00
Petr Viktorin
6b2d7c0ddb
gh-101101: Unstable C API tier (PEP 689) (GH-101102)
2023-02-28 09:31:01 +01:00
Irit Katriel
2db23d10bf
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Modules/) ( #102196 )
2023-02-24 21:43:03 +00:00
Erlend E. Aasland
efc985a714
gh-93649: Split exception tests from _testcapimodule.c (GH-102173)
...
Automerge-Triggered-By: GH:erlend-aasland
2023-02-23 07:03:13 -08:00
Mark Shannon
feec49c407
GH-101578: Normalize the current exception (GH-101607)
...
* Make sure that the current exception is always normalized.
* Remove redundant type and traceback fields for the current exception.
* Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException
* Add new API functions: PyException_GetArgs, PyException_SetArgs
2023-02-08 09:31:12 +00:00
Erlend E. Aasland
2b38a9aa74
gh-93649: Split tracemalloc tests from _testcapimodule.c ( #99551 )
2022-12-17 09:53:36 +01:00
colorfulappl
efbb1eb9f5
gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing ( #99890 )
...
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-12-17 12:07:44 +05:30
Itamar Ostricher
ae83c78215
GH-100000: Cleanup and polish various watchers code (GH-99998)
...
* Initialize `type_watchers` array to `NULL`s
* Optimize code watchers notification
* Optimize func watchers notification
2022-12-14 19:14:16 +00:00
Itamar Ostricher
1012dc1b43
GH-91054: Reset static events counts in code watchers tests ( #99978 )
2022-12-04 12:38:21 +00:00
Itamar Ostricher
3c137dc613
GH-91054: Add code object watchers API (GH-99859)
...
* Add API to allow extensions to set callback function on creation and destruction of PyCodeObject
Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
2022-12-02 17:28:27 +00:00
Serhiy Storchaka
f08e52ccb0
gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613)
...
Previously *consumed was not set in this case.
2022-12-01 14:54:51 +02:00
Serhiy Storchaka
deaa8dee48
gh-99593: Add tests for Unicode C API (part 1) (GH-99651)
...
Add tests for functions corresponding to the str class methods.
2022-11-29 09:59:56 +02:00
mpage
3db0a21f73
gh-91053: Add an optional callback that is invoked whenever a function is modified ( #98175 )
2022-11-22 13:06:44 +01:00