| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Mention explicitly that PyObject_CallXXX() functions raise an
exception an failure.
(cherry picked from commit 1ce2656f13e726b3b99d4c968926908cff1f460a)
|
| |
|
|
|
| |
(cherry picked from commit 5600b5e1b24a3491e83f1b3038a7ea047a34c0bf)
Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
|
| |
|
|
|
|
|
| |
(GH-13860) (GH-13896)
(cherry picked from commit dc2476500d91082f0c907772c83a044bf49af279)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
|
| |
handled (GH-7778)
``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python.
(cherry picked from commit 608876b6b1eb59538e6c29671a733033fb8b5be7)
Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
PyErr_WriteUnraisable() now displays the exception even if displaying
the traceback failed. Moreover, hold a strong reference to sys.stderr
while using it.
Document that an exception must be set when calling
PyErr_WriteUnraisable(), but don't add an assertion to check it at
runtime.
Cleanup: use longer names for variables and create
write_unraisable_exc_file() subfunction.
|
| |
|
|
|
| |
(cherry picked from commit d28772ab6967fea136c0707f0207673ebad66f61)
Co-authored-by: Edison A <20975616+SimiCode@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
Update 'unicode' capitalization. 'Unicode' is a proper noun, and as such should be capitalized.
Changed multiple instances.
(cherry picked from commit 85225b6a58a516c50c055d5114668ed2fcdcda8c)
Co-authored-by: toonarmycaptain <toonarmycaptain@hotmail.com>
|
| |
|
|
|
|
|
| |
PyDateTime_FromDateAndTimeAndFold (GH-13147)
(cherry picked from commit 5765ecf79fcee987f2f97c246c64b494324dfd33)
Co-authored-by: Edison A <20975616+SimiCode@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
can terminate the calling thread (GH-12541) (GH-12820)
Calling these function from a thread when the runtime is finalizing will terminate
the thread, even if the thread was not created by Python. Users can use
_Py_IsFinalizing or sys.is_finalizing to check if the interpreter is in the process of
being finalized before calling this function to avoid unwanted termination.
(cherry picked from commit fde9b33)
|
| |
|
|
|
| |
(cherry picked from commit c88feceb449d6e85d7e17ec36559206094d10d81)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-12770) (GH-12788)
* bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)
Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline
function. The function is now way more efficient, it became a simple
comparison on integers, rather than a short loop. It detects also
uninitialized bytes and "forbidden bytes" filled by debug hooks
on memory allocators.
Add unit tests on _PyObject_IsFreed().
(cherry picked from commit 2b00db68554422ec37faba2a80179a0172df6349)
* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)
Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD,
0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte
patterns than Windows CRT debug malloc() and free().
(cherry picked from commit 4c409beb4c360a73d054f37807d3daad58d1b567)
|
| |
|
|
|
| |
(cherry picked from commit f4efa312d14bc792f59514c5696e29041e05deca)
Co-authored-by: Andre Delfino <adelfino@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
I have added documentation for `PyInterpreterState_Main()`.
I chose to place it under Advanced Debugger Support together with similar functions like `PyInterpreterState_Head()`, `PyInterpreterState_Next(`), and `PyInterpreterState_ThreadHead()` .
https://bugs.python.org/issue36157
(cherry picked from commit 8c61739defd88c7f79e86537886c33745843ce01)
Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
|
| |
|
| |
(cherry picked from commit 10654c19b5e6efdf3c529ff9bf7bcab89bdca1c1)
|
| |
|
|
|
| |
(cherry picked from commit ddbb978e1065dde21d1662386b26ded359f4b16e)
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit ecc161d1209bf6d21f0fd6bef28476eda7cdaf79)
Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
|
| |
|
|
|
|
|
|
| |
Did you know an API documented as printing the pending traceback would sometimes exit the process?
You do now.
(cherry picked from commit 4173772031747a9b249be4100b4aa9eda805ea23)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
| |
|
|
|
|
|
| |
(GH-11929)
(cherry picked from commit d90a141bb947b68601f8d1f37bc98f7b524f0e01)
Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 57dd79e6f7f33bb4e6817ac58c9cb91de99675e0)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 3fcc1e08db6fb7e17acc4a8f63be3e42f52f094b)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 55f41e45b4318cbe19209f5144641344d0049fb8)
Co-authored-by: Andre Delfino <adelfino@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit a40700439195a119878150f4f0d425c42ca957ef)
Co-authored-by: Kevin Adler <kadler@us.ibm.com>
|
| |
|
|
|
|
| |
PyType_GetFlags() return type is unsigned long, not long.
(cherry picked from commit 9fbcfc08e5814d7aa9287740187e461425a99f67)
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as (GH-10580) (GH-10586)
Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.cGH-L51
Source of PyUnicode_FromString
https://github.com/python/cpython/blob/master/Include/unicodeobject.hGH-L702
https://bugs.python.org/issue25438
(cherry picked from commit 689d555ec135d4115574addd063c358ac4897cc4)
Co-authored-by: Windson yang <wiwindson@outlook.com>
https://bugs.python.org/issue25438
|
| |
|
|
|
| |
Deprecate _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() in the
documentation. These macros are removed from Python 3.8 by the commit
1a6be91e6fd65ce9cb88cbbbb193db7e92ec6076.
|
| |
|
|
|
|
| |
(GH-10231). (GH-10253)
(cherry picked from commit 3f819ca138db6945ee4271bf13e42db9f9b3b1e4)
|
| |
|
|
|
| |
(cherry picked from commit e483f02423917dc4dfd25f46e5b9e6fce304777d)
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-9830)
Replace "Availability: xxx" with ".. availability:: xxx" in the doc.
Original patch by Georg Brandl.
Co-Authored-By: Georg Brandl <georg@python.org>
(cherry picked from commit 2d6097d027e0dd3debbabc702aa9c98d94ba32a3)
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 2ec872b31e25cee1f983fe07991fb53f3fd1cbac)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
| |
|
|
|
|
|
|
|
| |
Also, update the list of exceptions that may raised by PyMarshal_*
functions. We usually don't document exceptions raised by a
function, but in this case most of them were already documented
in C API and standard library documentation.
(cherry picked from commit defcffdf86780e3a184ebb25dc9a7b807753d57a)
Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 5092439c2cb32112a5869b138011d38491db90a9)
Co-authored-by: Andrés Delfino <adelfino@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit b2f5f59ae15564b991f3ca4850e6ad28d9faacbc)
Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
|
| |
|
|
|
| |
(cherry picked from commit f5b1183610d5888db3bbd639b1a0c945dbd8f8dd)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 1179f4b40f375af5c59cd4b6be9cc313fa0e1a37)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit bde3e0bf096219234321ca9898fc3d3aed598453)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
Py_UNICODE is deprecated since Python 3.3.
But the deprecation is missed in the c-api/arg document.
(cherry picked from commit 42ec190761a2e8503aaa06f0bfaaabe98749179b)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit aa50bf08e64f49d57917ab0b1aadf4308a3168a6)
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
|
| |
|
|
|
|
|
|
|
|
|
| |
- new test case for pre-initialization of sys.warnoptions and sys._xoptions
- restored ability to call these APIs prior to Py_Initialize
- updated the docs for the affected APIs to make it clear they can be
called before Py_Initialize
- also enhanced the existing embedding test cases
to check for expected settings in the sys module
(cherry picked from commit bc77eff8b96be4f035e665ab35c1d06e22f46491)
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
|
| |
|
|
|
|
|
|
| |
Multi-phase initialized modules allow m_traverse to be called while the
module is still being initialized, so module authors may need to account
for that.
(cherry picked from commit c2b0b12d1a137ada1023ab7c10b8d9a0249d95f9)
Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
|
| |
|
|
|
|
|
|
| |
PySequence_Length() (GH-5767)
Dropped the part that says: "For objects that do not provide sequence protocol".
(cherry picked from commit 7a1e1786f98ad49caa157dcdf14ada9d0b07d0fd)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-5587) (GH-5597)
(cherry picked from commit 5bb0005f9ff768ac443924b4bb26c3818ce8dc5a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
| |
The GIL is no longer created "on demand" to fix a race condition when
PyGILState_Ensure() is called in a non-Python thread.
|
| |
|
|
|
|
| |
Document the error return of PyLong_As* APIs.
A frequent Python C API usage error is neglecting to check the return
value and/or PyErr_Occurred().
|
| |
|
| |
It will be triggered when propagating an exception.
|
| |
|
|
| |
Updating the C API docs was missed when the per-opcode
tracing & profiling support was initially added.
|
| |
|
|
|
|
| |
(#5361)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add timezone to datetime C API
* Add documentation for timezone C API macros
* Add dedicated tests for datetime type check macros
* Remove superfluous C API test
* Drop support for TimeZoneType in datetime C API
* Expose UTC singleton to the datetime C API
* Update datetime C-API documentation to include links
* Add reference count information for timezone constructors
|
| | |
|
| |
|
|
|
|
|
|
| |
PyUnicode_DecodeLocaleAndSize(), PyUnicode_DecodeLocale() and
PyUnicode_EncodeLocale() now use always use the UTF-8 encoding on
Android, instead of the current locale encoding.
On Android API 19, mbstowcs() and wcstombs() are broken and cannot be
used.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modify locale.localeconv(), time.tzname, os.strerror() and other
functions to ignore the UTF-8 Mode: always use the current locale
encoding.
Changes:
* Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx(). On decoding or
encoding error, they return the position of the error and an error
message which are used to raise Unicode errors in
PyUnicode_DecodeLocale() and PyUnicode_EncodeLocale().
* Replace _Py_DecodeCurrentLocale() with _Py_DecodeLocaleEx().
* PyUnicode_DecodeLocale() now uses _Py_DecodeLocaleEx() for all
cases, especially for the strict error handler.
* Add _Py_DecodeUTF8Ex(): return more information on decoding error
and supports the strict error handler.
* Rename _Py_EncodeUTF8_surrogateescape() to _Py_EncodeUTF8Ex().
* Replace _Py_EncodeCurrentLocale() with _Py_EncodeLocaleEx().
* Ignore the UTF-8 mode to encode/decode localeconv(), strerror()
and time zone name.
* Remove PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
and PyUnicode_EncodeLocale() now ignore the UTF-8 mode: always use
the "current" locale.
* Remove _PyUnicode_DecodeCurrentLocale(),
_PyUnicode_DecodeCurrentLocaleAndSize() and
_PyUnicode_EncodeCurrentLocale().
|