Skip to content

Commit 8282500

Browse files
authored
Merge pull request #446 from python/master
Sync Fork from Upstream Repo
2 parents 174dd5f + baf10da commit 8282500

File tree

8 files changed

+102
-82
lines changed

8 files changed

+102
-82
lines changed

Doc/data/stable_abi.dat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ PyExc_ConnectionRefusedError
192192
PyExc_ConnectionResetError
193193
PyExc_DeprecationWarning
194194
PyExc_EOFError
195+
PyExc_EncodingWarning
195196
PyExc_EnvironmentError
196197
PyExc_Exception
197198
PyExc_FileExistsError
@@ -615,6 +616,7 @@ PyType_GetFlags
615616
PyType_GetModule
616617
PyType_GetModuleState
617618
PyType_GetSlot
619+
PyType_HasFeature
618620
PyType_IsSubtype
619621
PyType_Modified
620622
PyType_Ready

Doc/whatsnew/3.10.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ Several other key features:
420420
- Mapping patterns: ``{"bandwidth": b, "latency": l}`` captures the
421421
``"bandwidth"`` and ``"latency"`` values from a dict. Unlike sequence
422422
patterns, extra keys are ignored. A wildcard ``**rest`` is also
423-
supported. (But ``**_`` would be redundant, so it not allowed.)
423+
supported. (But ``**_`` would be redundant, so is not allowed.)
424424
425425
- Subpatterns may be captured using the ``as`` keyword::
426426
@@ -462,13 +462,13 @@ Optional ``EncodingWarning`` and ``encoding="locale"`` option
462462
The default encoding of :class:`TextIOWrapper` and :func:`open` is
463463
platform and locale dependent. Since UTF-8 is used on most Unix
464464
platforms, omitting ``encoding`` option when opening UTF-8 files
465-
(e.g. JSON, YAML, TOML, Markdown) is very common bug. For example::
465+
(e.g. JSON, YAML, TOML, Markdown) is a very common bug. For example::
466466
467467
# BUG: "rb" mode or encoding="utf-8" should be used.
468468
with open("data.json") as f:
469-
data = json.laod(f)
469+
data = json.load(f)
470470
471-
To find this type of bugs, optional ``EncodingWarning`` is added.
471+
To find this type of bug, optional ``EncodingWarning`` is added.
472472
It is emitted when :data:`sys.flags.warn_default_encoding <sys.flags>`
473473
is true and locale-specific default encoding is used.
474474

Lib/test/test_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def testReadinto_text(self):
5252
# verify readinto refuses text files
5353
a = array('b', b'x'*10)
5454
self.f.close()
55-
self.f = self.open(TESTFN, 'r')
55+
self.f = self.open(TESTFN, encoding="utf-8")
5656
if hasattr(self.f, "readinto"):
5757
self.assertRaises(TypeError, self.f.readinto, a)
5858

Lib/test/test_file_eintr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class TestTextIOSignalInterrupt(TestFileIOSignalInterrupt):
213213
def _generate_infile_setup_code(self):
214214
"""Returns the infile = ... line of code to make a TextIOWrapper."""
215215
return ('import %s as io ;'
216-
'infile = io.open(sys.stdin.fileno(), "rt", newline=None) ;'
216+
'infile = io.open(sys.stdin.fileno(), encoding="utf-8", newline=None) ;'
217217
'assert isinstance(infile, io.TextIOWrapper)' %
218218
self.modname)
219219

0 commit comments

Comments
 (0)