-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
See the exact line here:
Line 1687 in ee57221
errors = None # Error handler for unicode conversion. |
After that the errors is used only as string in encode/decode. And is initialized in the dunder init with default errors="surrogateescape"
.
So perhaps it would be a good idea to use errors=""
in #L1687 ? or directly with the default errors="surrogateescape"
?
This was discovered as part of the typeshed, where tarfile.TarFile.errors
was added into the allowed list since mypy complained: https://github.com/python/typeshed/blob/2ccc53bb6716463680fcf1d204642c46299b7f88/stdlib/%40tests/stubtest_allowlists/common.txt#L46C1-L46C16
I will add a PR here and to the typeshed if this gets approved.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
No status