Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
349a3d3a
Commit
349a3d3a
authored
Jun 21, 2000
by
Marc-André Lemburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Marc-Andre Lemburg <mal@lemburg.com>:
Made codecs.open() default to 'rb' as file mode.
parent
d468bd34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
Lib/codecs.py
Lib/codecs.py
+6
-1
No files found.
Lib/codecs.py
View file @
349a3d3a
...
...
@@ -458,7 +458,7 @@ class StreamRecoder:
### Shortcuts
def
open
(
filename
,
mode
,
encoding
=
None
,
errors
=
'strict'
,
buffering
=
1
):
def
open
(
filename
,
mode
=
'rb'
,
encoding
=
None
,
errors
=
'strict'
,
buffering
=
1
):
""" Open an encoded file using the given mode and return
a wrapped version providing transparent encoding/decoding.
...
...
@@ -468,6 +468,11 @@ def open(filename, mode, encoding=None, errors='strict', buffering=1):
codecs. Output is also codec dependent and will usually by
Unicode as well.
Files are always opened in binary mode, even if no binary mode
was specified. Thisis done to avoid data loss due to encodings
using 8-bit values. The default file mode is 'rb' meaning to
open the file in binary read mode.
encoding specifies the encoding which is to be used for the
the file.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment