Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions 3 Doc/library/base64.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ Refer to the documentation of the individual functions for more information.
*adobe* controls whether the input sequence is in Adobe Ascii85 format
(i.e. is framed with <~ and ~>).

*ignorechars* should be a :term:`bytes-like object` or ASCII string
containing characters to ignore
*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.

Expand Down
13 changes: 13 additions & 0 deletions 13 Lib/test/test_base64.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,19 @@ def test_a85decode_errors(self):
self.assertRaises(ValueError, base64.a85decode, b'aaaay',
foldspaces=True)

self.assertEqual(base64.a85decode(b"a b\nc", ignorechars=b" \n"),
b'\xc9\x89')
with self.assertRaises(ValueError):
base64.a85decode(b"a b\nc", ignorechars=b"")
with self.assertRaises(ValueError):
base64.a85decode(b"a b\nc", ignorechars=b" ")
with self.assertRaises(ValueError):
base64.a85decode(b"a b\nc", ignorechars=b"\n")
with self.assertRaises(TypeError):
base64.a85decode(b"a b\nc", ignorechars=" \n")
with self.assertRaises(TypeError):
base64.a85decode(b"a b\nc", ignorechars=None)

def test_b85decode_errors(self):
illegal = list(range(33)) + \
list(b'"\',./:[\\]') + \
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.