Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

bpo-43510: Implement PEP 597 opt-in EncodingWarning.#19481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
methane merged 51 commits intopython:masterfrommethane:open-encoding
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
51 commits
Select commitHold shift + click to select a range
a3c014b
Raise a warning when encoding is omitted
methaneApr 7, 2020
050bd1b
add test
methaneApr 12, 2020
939f4a0
wrap encoding=None with text_encoding.
methaneApr 12, 2020
3c99777
Add io.LOCALE_ENCODING = "locale"
methaneJan 29, 2021
4016278
Add EncodingWarning.
methaneJan 29, 2021
c5c556c
Add sys.warn_default_encoding
methaneJan 29, 2021
d9a08c2
shorten option names
methaneJan 30, 2021
772648e
EncodingWarning extends Warning
methaneJan 30, 2021
1a8e305
make clinic
methaneJan 30, 2021
20966cd
fix test
methaneJan 30, 2021
2b80f42
remove wrong test case
methaneJan 30, 2021
760308c
fix exception_hierarchy.txt
methaneJan 30, 2021
a95dff2
Make sys.flags.encoding_warning int
methaneJan 31, 2021
31fb411
Fix text_embed.
methaneJan 31, 2021
096a0a3
Fix test_pickle
methaneJan 31, 2021
99fc938
configparser: use io.text_encoding()
methaneFeb 13, 2021
6fdbcbc
Rename option names
methaneFeb 22, 2021
3f362bc
Merge remote-tracking branch 'upstream/master' into open-encoding
methaneMar 16, 2021
674feff
Update docs
methaneMar 16, 2021
d9d850f
Add NEWS entry
methaneMar 16, 2021
16463ea
Add document for text_encoding and encoding="locale".
methaneMar 17, 2021
412d633
Suppress EncodingWarning from site.py
methaneMar 17, 2021
ee883d1
Remove io.LOCALE_ENCODING
methaneMar 18, 2021
6a15e2a
text_encoding() first argument is mandatory.
methaneMar 18, 2021
5d474b4
Apply suggestions from code review
methaneMar 18, 2021
c17016f
Simplify _PyPreCmdline and PyConfig
methaneMar 18, 2021
03f971c
Update EncodingWarning doc
methaneMar 18, 2021
9d26b7a
Update document
methaneMar 19, 2021
60e74cf
tweak warning message
methaneMar 19, 2021
a505b5f
Use stacklevel=2 for text_encoding() default
methaneMar 19, 2021
cbe22e2
fixup
methaneMar 19, 2021
a9f9f04
tweak for readability
methaneMar 19, 2021
3bea88f
make clinic
methaneMar 19, 2021
d260a4c
fix doc build error
methaneMar 19, 2021
049a269
tweak warning message
methaneMar 19, 2021
018ba64
fixup
methaneMar 19, 2021
3a9623e
Fix subprocess
methaneMar 23, 2021
737059e
Update Doc/library/io.rst
methaneMar 23, 2021
6a62211
Update Doc/library/io.rst
methaneMar 23, 2021
54c7dc6
Update Doc/library/io.rst
methaneMar 23, 2021
5b2830b
Update Doc/library/io.rst
methaneMar 23, 2021
14f2a6e
Apply suggestions from code review
methaneMar 23, 2021
06e2a32
Move EncodingWarnings
methaneMar 23, 2021
27d49d2
fix comment
methaneMar 23, 2021
80f4644
fix text_encoding() docstring
methaneMar 23, 2021
6ad0e7f
update what's new
methaneMar 23, 2021
73b27f1
fix doc build
methaneMar 23, 2021
c149d65
Update Doc/library/io.rst
methaneMar 24, 2021
4eb7655
Apply suggestions from code review
methaneMar 24, 2021
e3bce76
Apply suggestions from code review
methaneMar 24, 2021
c089fd7
Update Doc/library/io.rst
methaneMar 24, 2021
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
PrevPrevious commit
NextNext commit
wrap encoding=None with text_encoding.
  • Loading branch information
@methane
methane committedJan 29, 2021
commit939f4a016c2997f09efbdc7fab5ce5ff3caa926f
1 change: 1 addition & 0 deletionsLib/bz2.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -311,6 +311,7 @@ def open(filename, mode="rb", compresslevel=9,
binary_file = BZ2File(filename, bz_mode, compresslevel=compresslevel)

if "t" in mode:
encoding = io.text_encoding(encoding)
return io.TextIOWrapper(binary_file, encoding, errors, newline)
else:
return binary_file
Expand Down
1 change: 1 addition & 0 deletionsLib/gzip.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,6 +62,7 @@ def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_BEST,
raise TypeError("filename must be a str or bytes object, or a file")

if "t" in mode:
encoding = io.text_encoding(encoding)
return io.TextIOWrapper(binary_file, encoding, errors, newline)
else:
return binary_file
Expand Down
1 change: 1 addition & 0 deletionsLib/lzma.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -302,6 +302,7 @@ def open(filename, mode="rb", *,
preset=preset, filters=filters)

if "t" in mode:
encoding = io.text_encoding(encoding)
return io.TextIOWrapper(binary_file, encoding, errors, newline)
else:
return binary_file
Expand Down
7 changes: 7 additions & 0 deletionsLib/tempfile.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -535,6 +535,9 @@ def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
if _os.name == 'nt' and delete:
flags |= _os.O_TEMPORARY

if "b" not in mode:
encoding = _io.text_encoding(encoding)

(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
try:
file = _io.open(fd, mode, buffering=buffering,
Expand DownExpand Up@@ -575,6 +578,9 @@ def TemporaryFile(mode='w+b', buffering=-1, encoding=None,
"""
global _O_TMPFILE_WORKS

if "b" not in mode:
encoding = _io.text_encoding(encoding)

prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)

flags = _bin_openflags
Expand DownExpand Up@@ -630,6 +636,7 @@ def __init__(self, max_size=0, mode='w+b', buffering=-1,
if 'b' in mode:
self._file = _io.BytesIO()
else:
encoding = _io.text_encoding(encoding)
self._file = _io.TextIOWrapper(_io.BytesIO(),
encoding=encoding, errors=errors,
newline=newline)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp