Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dir
Description
The base64.a85decode() docstring documents the ignorechars parameter as:
ignorechars should be a byte string containing characters to ignore from the input. This should only contain whitespace characters, and by default contains all whitespace characters in ASCII. But the reStructuredText documentation documents it as:
*ignorechars* should be a :term:`bytes-like object` or ASCII string containing characters to ignore from the input. This should only contain whitespace characters, and by default contains all whitespace characters in ASCII.ASCII string does not work as ignorechars.
>>> import base64 >>> base64.a85decode(b'', ignorechars=b'') b'' >>> base64.a85decode(b'', ignorechars='') TypeError: 'in <string>' requires string as left operand, not intThe change was introduced in a198645 (bpo-1753718).
Also, the "bytes-like object" term is vague and has different meaning in different places. Usually it means support of the buffer protocol, but in this case the code does not work with arbitrary objects implementing the buffer protocol. So I think it is better to return the old "byte string", as in the docstring.
cc @bitdancer.
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
Status
Todo