Move private _PyModule API to the internal C API
(pycore_moduleobject.h):
* _PyModule_Clear()
* _PyModule_ClearDict()
* _PyModuleSpec_IsInitializing()
* _PyModule_IsExtension()
No longer export these functions.
Rename private C API constants:
* Rename PY_MONITORING_UNGROUPED_EVENTS to _PY_MONITORING_UNGROUPED_EVENTS
* Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS
Move the private _PyInterpreterID C API to the internal C API: add a
new pycore_interp_id.h header file.
Remove Include/interpreteridobject.h and
Include/cpython/interpreteridobject.h header files.
in the case of an empty FRAMEWORKALTINSTALLLAST, this patch prevents leaving
an astray linebreak and two tabs in the resulting Makefile.
Before change:
```
.PHONY: commoninstall
commoninstall: check-clean-src \
altbininstall libinstall inclinstall libainstall \
sharedinstall altmaninstall \
```
After change (with empty FRAMEWORKALTINSTALLLAST):
```
.PHONY: commoninstall
commoninstall: check-clean-src \
altbininstall libinstall inclinstall libainstall \
sharedinstall altmaninstall
```
Use lowercase `mail from` and `rcpt to` in `smtplib.SMTP`
SMTP commands are case-insensitive. `smtplib` uses lowercase commands,
however it writes `mail FROM` and `rcpt TO`, lacking consistency.
Move private _PyGen API to internal C API:
* _PyAsyncGenAThrow_Type
* _PyAsyncGenWrappedValue_Type
* _PyCoroWrapper_Type
* _PyGen_FetchStopIterationValue()
* _PyGen_Finalize()
* _PyGen_SetStopIterationValue()
No longer these symbols, except of the ones by the _asyncio shared
extensions.
* No longer export most private _PyHash symbols, only export the ones
which are needed by shared extensions.
* Modules/_xxtestfuzz/fuzzer.c now uses the internal C API.
There are 3 paths to use `locale` argument in
`calendar.Locale{Text|HTML}Calendar.__init__(..., locale=None)`:
(1) `locale=None` -- denotes the "default locale"[1]
(2) `locale=""` -- denotes the native environment
(3) `locale=other_valid_locale` -- denotes a custom locale
So far case (2) is covered and case (1) is in 78935daf5a (same branch).
This commit adds a remaining case (3).
[1] In the current implementation, this translates into the following
approach:
GET current locale
IF current locale == "C" THEN
SET current locale TO ""
GET current locale
ENDIF
* Remove unreachable code (and increase test coverage)
This condition cannot be true. `_locale.setlocale()` from the C module
raises `locale.Error` instead of returning `None` for
`different_locale.__enter__` (where `self.oldlocale` is set).
* Expand the try clause to calls to `LocaleTextCalendar.formatmonthname()`.
This method temporarily changes the current locale to the given locale,
so `_locale.setlocale()` may raise `local.Error`.
Co-authored-by: Rohit Mediratta <rohitm@gmail.com>
Co-authored-by: Jessica McKellar <jesstess@mit.edu>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Remove private _PyUnicode_AsString() alias to PyUnicode_AsUTF8(). It
was kept for backward compatibility with Python 3.0 - 3.2.
The PyUnicode_AsUTF8() is available since Python
3.3. The PyUnicode_AsUTF8String() function can be used to keep
compatibility with Python 3.2 and older.
The "New Modules" section was left in place to ensure that the anchor
link for new modules will still exist:
/whatsnew/3.12.html#new-modules
/whatsnew/3.10.html#new-modules
This means that existing links to this section don't break.