gh-64612: Update error handlers list under open()#137304
gh-64612: Update error handlers list under open()#137304encukou merged 4 commits intopython:mainfrom
open()#137304Conversation
encukou
left a comment
There was a problem hiding this comment.
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?
Doc/library/functions.rst
Outdated
| 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.
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.
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.
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. |
encukou
left a comment
There was a problem hiding this comment.
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: raiseUnicodeErrorignore: omit malformed datareplace: replace with?or�backslashreplace: replace with\xhh,\uhhhh, or\Uhhhhhhhh
and so on?
Doc/library/functions.rst
Outdated
| 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.
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! |
…37304) This was duplicated and out-of date.
📚 Documentation preview 📚: https://cpython-previews--137304.org.readthedocs.build/