summaryrefslogtreecommitdiff
path: root/Lib/codecs.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-10-21 16:28:25 -0700
committerGitHub <noreply@github.com>2022-10-21 16:28:25 -0700
commitdcb342b5f9d931b030ca310bf3e175bbc54df5aa (patch)
tree0be491d07b50a679165e7a57c1c1ec688d654fcf /Lib/codecs.py
parent0e4e058602d93b88256ff90bbef501ba20be9dd3 (diff)
downloadcpython-git-dcb342b5f9d931b030ca310bf3e175bbc54df5aa.tar.gz
gh-51511: Note that codecs.open()'s encoding parameter affects automatic conversion to binary mode (GH-94370)
(cherry picked from commit d9407b174c81fda33e6c09a6f988c9a7cb8368af) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r--Lib/codecs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py
index e6ad6e3a05..3b173b6121 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -878,7 +878,8 @@ def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):
codecs. Output is also codec dependent and will usually be
Unicode as well.
- Underlying encoded files are always opened in binary mode.
+ If encoding is not None, then the
+ underlying encoded files are always opened in binary mode.
The default file mode is 'r', meaning to open the file in read mode.
encoding specifies the encoding which is to be used for the