Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cpython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
Cpython
Commits
05dfc539
Unverified
Commit
05dfc539
authored
2 years ago
by
Sam Ezeh
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gh-90717: Update the documentation for the altchars paremeter in base64 library (GH-94187)
parent
74d5f61e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Doc/library/base64.rst
+11
-8
11 additions, 8 deletions
Doc/library/base64.rst
with
11 additions
and
8 deletions
Doc/library/base64.rst
+
11
−
8
View file @
05dfc539
...
...
@@ -53,11 +53,13 @@ The modern interface provides:
Encode the :term:`bytes-like object` *s* using Base64 and return the encoded
:class:`bytes`.
Optional *altchars* must be a :term:`bytes-like object` of at least
length 2 (additional characters are ignored) which specifies an alternative
alphabet for the ``+`` and ``/`` characters. This allows an application to e.g.
generate URL or filesystem safe Base64 strings. The default is ``None``, for
which the standard Base64 alphabet is used.
Optional *altchars* must be a :term:`bytes-like object` of length 2 which
specifies an alternative alphabet for the ``+`` and ``/`` characters.
This allows an application to e.g. generate URL or filesystem safe Base64
strings. The default is ``None``, for which the standard Base64 alphabet is used.
May assert or raise a a :exc:`ValueError` if the length of *altchars* is not 2. Raises a
:exc:`TypeError` if *altchars* is not a :term:`bytes-like object`.
.. function:: b64decode(s, altchars=None, validate=False)
...
...
@@ -65,9 +67,9 @@ The modern interface provides:
Decode the Base64 encoded :term:`bytes-like object` or ASCII string
*s* and return the decoded :class:`bytes`.
Optional *altchars* must be a :term:`bytes-like object` or ASCII string
of
at least
length 2
(additional characters are ignored) which specifies
the
alternative alphabet used instead of the
``+`` and ``/`` characters.
Optional *altchars* must be a :term:`bytes-like object` or ASCII string
of
length 2
which specifies the alternative alphabet used instead of
the
``+`` and ``/`` characters.
A :exc:`binascii.Error` exception is raised
if *s* is incorrectly padded.
...
...
@@ -80,6 +82,7 @@ The modern interface provides:
For more information about the strict base64 check, see :func:`binascii.a2b_base64`
May assert or raise a :exc:`ValueError` if the length of *altchars* is not 2.
.. function:: standard_b64encode(s)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment