gh-73427: deprecate _enablelegacywindowsfsencoding (#107729)

This commit is contained in:
Inada Naoki 2023-12-28 17:31:19 +09:00 committed by GitHub
parent 7ab9efdd6a
commit bfee2f77e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 0 deletions

View file

@ -1715,6 +1715,13 @@ static PyObject *
sys__enablelegacywindowsfsencoding_impl(PyObject *module)
/*[clinic end generated code: output=f5c3855b45e24fe9 input=2bfa931a20704492]*/
{
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"sys._enablelegacywindowsfsencoding() is deprecated and will be "
"removed in Python 3.16. Use PYTHONLEGACYWINDOWSFSENCODING "
"instead.", 1))
{
return NULL;
}
if (_PyUnicode_EnableLegacyWindowsFSEncoding() < 0) {
return NULL;
}