-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-3046 Document support for backslashreplace and surrogateescape #836
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
Conversation
@@ -233,7 +233,8 @@ class CodecOptions(_options_base): | |||
- `unicode_decode_error_handler`: The error handler to apply when | |||
a Unicode-related error occurs during BSON decoding that would | |||
otherwise raise :exc:`UnicodeDecodeError`. Valid options include | |||
'strict', 'replace', and 'ignore'. Defaults to 'strict'. | |||
'strict', 'replace', 'backslashreplace', 'surrogateescape', and | |||
'ignore'. Defaults to 'strict'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided not to link to https://docs.python.org/3/library/codecs.html#error-handlers here because not all of Python's builtin handlers work with bson decoding. For example xmlcharrefreplace, namereplace, and surrogatepass do not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -233,7 +233,8 @@ class CodecOptions(_options_base): | |||
- `unicode_decode_error_handler`: The error handler to apply when | |||
a Unicode-related error occurs during BSON decoding that would | |||
otherwise raise :exc:`UnicodeDecodeError`. Valid options include | |||
'strict', 'replace', and 'ignore'. Defaults to 'strict'. | |||
'strict', 'replace', 'backslashreplace', 'surrogateescape', and | |||
'ignore'. Defaults to 'strict'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Makes sense.
No description provided.