-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-64612: Update error handlers list under open()
#137304
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
base: main
Are you sure you want to change the base?
Conversation
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'm not convinced the two-column table, with name in the first column and prose in the second, is better than a buletted list. (Especially as two tables with unaligned columns.)
The "reproduced below for convenience" sounds like the tables should be the same. Perhaps "summarized below for convenience" would be better, with additional details left out?
when writing data. This is useful for processing files in an | ||
unknown encoding. | ||
* - ``'surrogatepass'`` | ||
- Only available for Unicode codecs. |
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.
Aren't these all Unicode codecs?
- Only available for Unicode codecs. | |
- Only available for UTF-8, UTF-16 and UTF-32 codecs. |
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.
The codecs documentation lists the little/big endian variants, though I think wr can be less specific here.
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.
We can, but “Unicode codecs” sounds like a proper term, while I see no definition that would link it to the UTF-{8,16,32} codecs specifically.
I see, it is a table in the codecs docs and so, in an attempt to make them consistent converted it to (albeit a more convenient form of) a table. |
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.
With 3-5 lines per entry, it could just as well be a copy of the original table.
What about making the summary super brief, something like:
strict
: raiseUnicodeError
ignore
: omit malformed datareplace
: replace with?
or�
backslashreplace
: replace with\xhh
,\uhhhh
, or\Uhhhhhhhh
and so on?
when writing data. This is useful for processing files in an | ||
unknown encoding. | ||
* - ``'surrogatepass'`` | ||
- Only available for Unicode codecs. |
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.
We can, but “Unicode codecs” sounds like a proper term, while I see no definition that would link it to the UTF-{8,16,32} codecs specifically.
Counter proposal, why bother with super short summaries when we can just link straight to the main table? |
That sounds good, too! |
📚 Documentation preview 📚: https://cpython-previews--137304.org.readthedocs.build/