Skip to content

bpo-34523: Support surrogatepass in locale codecs #8995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2018
Merged

bpo-34523: Support surrogatepass in locale codecs #8995

merged 1 commit into from
Aug 29, 2018

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 29, 2018

Add support for the "surrogatepass" error handler in
PyUnicode_DecodeFSDefault() and PyUnicode_EncodeFSDefault().

Changes:

  • _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() now uses
    the _Py_error_handler enum instead of "int surrogateescape" to pass
    the error handler. These functions now return -3 if the error
    handler is unknown.
  • _Py_DecodeUTF8Ex() and _Py_EncodeUTF8Ex() now support the
    surrogatepass error handler (_Py_ERROR_SURROGATEPASS).
  • Add unit tests for _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx()
    in test_codecs.
  • Rename get_error_handler() to _Py_GetErrorHandler() and expose it
    as a private function.
  • _freeze_importlib doesn't need config.filesystem_errors="strict"
    workaround anymore.

https://bugs.python.org/issue34523

Add support for the "surrogatepass" error handler in
PyUnicode_DecodeFSDefault() and PyUnicode_EncodeFSDefault().

Changes:

* _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() now uses
  the _Py_error_handler enum instead of "int surrogateescape" to pass
  the error handler. These functions now return -3 if the error
  handler is unknown.
* _Py_DecodeUTF8Ex() and _Py_EncodeUTF8Ex() now support the
  surrogatepass error handler (_Py_ERROR_SURROGATEPASS).
* Add unit tests for _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx()
  in test_codecs.
* Rename get_error_handler() to _Py_GetErrorHandler() and expose it
  as a private function.
* _freeze_importlib doesn't need config.filesystem_errors="strict"
  workaround anymore.
@vstinner vstinner merged commit 3d4226a into python:master Aug 29, 2018
@vstinner vstinner deleted the surrogatepass branch August 29, 2018 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants