]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 years agobpo-26901: Fix the Argument Clinic test suite (GH-8879) (GH-9048) 9054/head
Miss Islington (bot) [Mon, 3 Sep 2018 22:24:17 +0000 (18:24 -0400)] 
bpo-26901: Fix the Argument Clinic test suite (GH-8879) (GH-9048)

* Fix Tools/clinic/clinic_test.py: add missing
  FakeClinic.destination_buffers attribute and pass a file argument
  to Clinic().
* Rename Tools/clinic/clinic_test.py to Lib/test/test_clinic.py:
  add temporary Tools/clinic/ to sys.path to import the clinic
  module.

Co-Authored-By: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit 65fc98e7b1f62c2e621f04780a3a77c3498cc195)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
7 years ago_Py_CoerceLegacyLocale() restores LC_CTYPE on fail (GH-9044) (GH-9046)
Victor Stinner [Mon, 3 Sep 2018 20:17:07 +0000 (22:17 +0200)] 
_Py_CoerceLegacyLocale() restores LC_CTYPE on fail (GH-9044) (GH-9046)

bpo-34544: If _Py_CoerceLegacyLocale() fails to coerce the C locale,
restore the LC_CTYPE locale to the its previous value.

(cherry picked from commit 8ea09110d413829f71d979d8c7073008cb87fb03)

7 years agoFix struct sequence glossary entry grammar (GH-9030)
Miss Islington (bot) [Sun, 2 Sep 2018 02:13:34 +0000 (22:13 -0400)] 
Fix struct sequence glossary entry grammar (GH-9030)

... by removing a superfluous "either".

Reported by Никита Люшненко on docs@.
(cherry picked from commit 98b976a2f82ba5f50cf6846338f644ca6c64f47d)

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
7 years agocloses bpo-34555: Fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H (GH-9016)
Miss Islington (bot) [Sat, 1 Sep 2018 22:30:44 +0000 (18:30 -0400)] 
closes bpo-34555: Fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H (GH-9016)

(cherry picked from commit 2d7102e726e973ab2d307aa9748c7ec433677877)

Co-authored-by: Thomas Herzog <thomas@mcduke.net>
7 years agoFix typo in typing.py module docstring (GH-9014)
Miss Islington (bot) [Sat, 1 Sep 2018 09:15:40 +0000 (05:15 -0400)] 
Fix typo in typing.py module docstring (GH-9014)

"explicitelly" → "explicitly"
(cherry picked from commit 5265b3a98b376684e361b62d0728483b26f493f2)

Co-authored-by: Tim McNamara <code@timmcnamara.co.nz>
7 years agobpo-34558: Add missing parentheses in _aix.py (GH-9017)
Miss Islington (bot) [Sat, 1 Sep 2018 02:46:32 +0000 (22:46 -0400)] 
bpo-34558: Add missing parentheses in _aix.py (GH-9017)

p.wait()
(cherry picked from commit 172a71f19bb5e9624651850b315f403c460b9699)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
7 years agobpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9018)
Miss Islington (bot) [Fri, 31 Aug 2018 22:47:20 +0000 (18:47 -0400)] 
bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9018)

Sometimes some versions of the shared libraries that are part of the
traceback are compiled in optimised mode and the Program Counter (PC)
is not present, not allowing gdb to walk the frames back. When this
happens, the Python bindings of gdb raise an exception, making the
test impossible to succeed.
(cherry picked from commit f2ef51f8bec525b21e52988880c8a029642795ed)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
7 years agobpo-34062: Add missing launcher argument and make behavior consistent between short...
Miss Islington (bot) [Fri, 31 Aug 2018 15:32:22 +0000 (11:32 -0400)] 
bpo-34062: Add missing launcher argument and make behavior consistent between short and long arguments (GH-8827)

Added previously missing "--list" argument.
Made "--list" and "--list-paths" behavior consistent with the corresponding "-0" and "-0p" arguments.
(cherry picked from commit aada63b20ec64bbfc4f2fb0718fc563eedbdd36a)

Co-authored-by: Brendan Gerrity <brerrity@gmail.com>
7 years agoAdd VSTS status badge to readme (GH-8958)
Steve Dower [Fri, 31 Aug 2018 15:17:36 +0000 (08:17 -0700)] 
Add VSTS status badge to readme (GH-8958)

7 years ago[3.7] bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986) (GH-8987)
Victor Stinner [Wed, 29 Aug 2018 09:01:33 +0000 (11:01 +0200)] 
[3.7] bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986) (GH-8987)

* bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986)

Standard streams like sys.stdout now use the "surrogateescape" error
handler, instead of "strict", on the POSIX locale (when the C locale is not
coerced and the UTF-8 Mode is disabled).

Add tests on sys.stdout.errors with LC_ALL=POSIX.

Fix the error handler of standard streams like sys.stdout:
PYTHONIOENCODING=":" is now ignored instead of setting the error handler to
"strict".

(cherry picked from commit 315877dc361d554bec34b4b62c270479ad36a1be)

7 years agobpo-34485: Fix _Py_InitializeCore() for C locale coercion (GH-8979) (GH-8981)
Victor Stinner [Tue, 28 Aug 2018 23:13:29 +0000 (01:13 +0200)] 
bpo-34485: Fix _Py_InitializeCore() for C locale coercion (GH-8979) (GH-8981)

* _Py_InitializeCore() now sets the LC_CTYPE locale to the user
  preferred locale before checking if the C locale should be coerced
  or not in _PyCoreConfig_Read().
* Fix pymain_read_conf(): remember if the C locale has been coerced
  when the configuration should be read again if the encoding has
  changed.

(cherry picked from commit 2c8ddcf4f14f3e4c87a6fe6678ab5ad09130c6ab)

7 years agobpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972) (GH-8974)
Victor Stinner [Tue, 28 Aug 2018 11:51:20 +0000 (13:51 +0200)] 
bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972) (GH-8974)

* The UTF-8 Mode is now also enabled by the "POSIX" locale, not only
  by the "C" locale.
* On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces
  the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if
  the LC_CTYPE locale is "C".
* test_utf8_mode.test_cmd_line() checks also that the command line
  arguments are decoded from UTF-8 when the the UTF-8 Mode is enabled
  with POSIX locale or C locale.

(cherry picked from commit 5cb258950ce9b69b1f65646431c464c0c17b1510)

7 years agobpo-34171: Fix test_trace. (GH-8940) (GH-8951)
Miss Islington (bot) [Tue, 28 Aug 2018 08:41:43 +0000 (04:41 -0400)] 
bpo-34171: Fix test_trace. (GH-8940) (GH-8951)

Remove "trace.cover" left from previous test runs before testing
that it is no longer created.
(cherry picked from commit b44a1d4f71daf4edb948b9878f82a60891e4a2e1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agobpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)
Miss Islington (bot) [Mon, 27 Aug 2018 22:37:18 +0000 (18:37 -0400)] 
bpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)

(cherry picked from commit 216b745eafa7cd4a683a8405dcfbd7f5567f504c)

Co-authored-by: Przemysław Spodymek <przemyslaw@spodymek.com>
7 years agobpo-34434: Update doc for bool(), float() and int() arguments (GH-8834)
Miss Islington (bot) [Mon, 27 Aug 2018 10:58:56 +0000 (06:58 -0400)] 
bpo-34434: Update doc for bool(), float() and int() arguments (GH-8834)

(cherry picked from commit 3fe89dac42809a7741d50ebf595be98833b79b97)

Co-authored-by: Louis Sautier <sautier.louis@gmail.com>
7 years agoRemove AIX workaround test_subprocess (GH-8939)
Miss Islington (bot) [Mon, 27 Aug 2018 00:32:48 +0000 (20:32 -0400)] 
Remove AIX workaround test_subprocess (GH-8939)

An old apparent AIX behavior workaround in test_subprocess's
test_undecodable_env is no longer needed.
(cherry picked from commit 89d79b1449750b14ded0149dcdd1e39247f2c65d)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
7 years agobpo-34503: Fix refleak in PyErr_SetObject() (GH-8934)
Miss Islington (bot) [Sun, 26 Aug 2018 17:13:47 +0000 (13:13 -0400)] 
bpo-34503: Fix refleak in PyErr_SetObject() (GH-8934)

(cherry picked from commit a2eefa67542c25617a58c03a27c17fd48e2a0856)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agocloses bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)
Miss Islington (bot) [Sun, 26 Aug 2018 00:03:48 +0000 (20:03 -0400)] 
closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)

Reported by Svace static analyzer.
(cherry picked from commit b57b4ac042b977e0b42a2f5ddb30ca7edffacfa9)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agocloses bpo-34501: PyType_FromSpecWithBases: Check spec->name before dereferencing...
Miss Islington (bot) [Sat, 25 Aug 2018 19:11:29 +0000 (15:11 -0400)] 
closes bpo-34501: PyType_FromSpecWithBases: Check spec->name before dereferencing it. (GH-8930)

Reported by Svace static analyzer.
(cherry picked from commit 5f79b50763d687aeeed8edcb4efcc7ac9f8fa186)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agocloses bpo-34502: Remove a note about utf8_mode from sys.exit() docs. (GH-8928)
Miss Islington (bot) [Sat, 25 Aug 2018 18:36:18 +0000 (14:36 -0400)] 
closes bpo-34502: Remove a note about utf8_mode from sys.exit() docs. (GH-8928)

(cherry picked from commit 44838be9f79870ff3c9e04b7398a1dc3d56d53ed)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years ago[3.7] bpo-34492: Modules/main.c: Fix copy_wstrlist() (GH-8910) (GH-8922)
Alexey Izbyshev [Sat, 25 Aug 2018 16:46:58 +0000 (19:46 +0300)] 
[3.7] bpo-34492: Modules/main.c: Fix copy_wstrlist() (GH-8910) (GH-8922)

* Add missing NULL check reported by Svace static analyzer.
* Fix clear_wstrlist() call on a wrong list.

(cherry picked from commit eb746dbae8b320758ee08f811316d7f283435cc0)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agoFix markup in stdtypes documentation (GH-8905)
Miss Islington (bot) [Sat, 25 Aug 2018 14:22:00 +0000 (10:22 -0400)] 
Fix markup in stdtypes documentation (GH-8905)

(cherry picked from commit 2e5d2ea2089e111fb8e5b8c5916242da2906c399)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agobpo-34171: Prevent creating Lib/trace.cover when run the trace module. (GH-8841)
Miss Islington (bot) [Sat, 25 Aug 2018 07:47:22 +0000 (03:47 -0400)] 
bpo-34171: Prevent creating Lib/trace.cover when run the trace module. (GH-8841)

(cherry picked from commit c406d5cd74002964a64c3eb7d9e2445a7fd3a03f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agocloses bpo-34493: Objects/genobject.c: Add missing NULL check to compute_cr_origin...
Miss Islington (bot) [Sat, 25 Aug 2018 07:36:34 +0000 (03:36 -0400)] 
closes bpo-34493: Objects/genobject.c: Add missing NULL check to compute_cr_origin() (GH-8911)

(cherry picked from commit 8fdd331bbf7e60dd81c02c7077f44c7939e2a05d)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agobpo-13312: Avoid int underflow in time year. (GH-8912)
Miss Islington (bot) [Sat, 25 Aug 2018 05:53:00 +0000 (01:53 -0400)] 
bpo-13312: Avoid int underflow in time year. (GH-8912)

Avoids an integer underflow in the time module's year handling code.
(cherry picked from commit 76be0fffff8b7dbe649ad4821144461800ffb0d0)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
7 years agoFixed typo with asynccontextmanager code example (GH-8845)
Miss Islington (bot) [Sat, 25 Aug 2018 02:51:10 +0000 (22:51 -0400)] 
Fixed typo with asynccontextmanager code example (GH-8845)

`yield conn`, instead of just `yield`.
(cherry picked from commit 416cbce22d5d8879986125f07b3e293421bc975d)

Co-authored-by: Alexander Vasin <hi@alvass.in>
7 years agobpo-33550: Warn not to set SIGPIPE to SIG_DFL (GH-6773)
Miss Islington (bot) [Sat, 25 Aug 2018 02:28:58 +0000 (22:28 -0400)] 
bpo-33550: Warn not to set SIGPIPE to SIG_DFL (GH-6773)

(cherry picked from commit a2510732da4c75789cc1750a034bdc9d9fdffb5b)

Co-authored-by: Alfred Perlstein <alfred@freebsd.org>
7 years agobpo-34426: fix typo (__lltrace__ -> __ltrace__) (GH-8822)
Miss Islington (bot) [Sat, 25 Aug 2018 02:14:11 +0000 (22:14 -0400)] 
bpo-34426: fix typo (__lltrace__ -> __ltrace__) (GH-8822)

(cherry picked from commit 09efe49c07e2d5f93b415ead757c87e20cc0026f)

Co-authored-by: Danish Prakash <grafitykoncept@gmail.com>
7 years agobpo-34448: Improve output of usable wchar_t check (GH-8846)
Miss Islington (bot) [Fri, 24 Aug 2018 16:36:30 +0000 (12:36 -0400)] 
bpo-34448: Improve output of usable wchar_t check (GH-8846)

(cherry picked from commit 3738fadc670274ecc4649f51b52a93602820a375)

Co-authored-by: Michael Osipov <1983-01-06@gmx.net>
7 years agocloses bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat_results...
Miss Islington (bot) [Fri, 24 Aug 2018 16:13:57 +0000 (12:13 -0400)] 
closes bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat_results. (GH-8869)

Reported by Svace static analyzer.
(cherry picked from commit 498845368ff0f6238750ab1d443e7cf4ec98ccd2)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agobpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks (GH-8864)
Miss Islington (bot) [Fri, 24 Aug 2018 14:44:47 +0000 (10:44 -0400)] 
bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks (GH-8864)

(cherry picked from commit 91cb298f811961277fd4cc4a32211899d48bedcb)

Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
7 years agoFix typo in the dataclasses's doc (GH-8896) (GH-8897)
Miss Islington (bot) [Fri, 24 Aug 2018 09:37:19 +0000 (05:37 -0400)] 
Fix typo in the dataclasses's doc (GH-8896) (GH-8897)

(cherry picked from commit 075b3c325913475be16650f7cb2a99f3136623b9)

Co-authored-by: Daniel Dương <dduong42@users.noreply.github.com>
7 years agocloses bpo-34468: Objects/rangeobject.c: Fix an always-false condition in range_repr...
Miss Islington (bot) [Fri, 24 Aug 2018 05:34:06 +0000 (01:34 -0400)] 
closes bpo-34468: Objects/rangeobject.c: Fix an always-false condition in range_repr() (GH-8880)

Also, propagate the error from PyNumber_AsSsize_t() because we don't care
only about OverflowError which is not reported if the second argument is NULL.

Reported by Svace static analyzer.
(cherry picked from commit 7ecae3ca0bda3cacf3b0125bae0bc718a17cc071)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agocloses bpo-34474: Python/bltinmodule.c: Add missing NULL check in builtin_sum_impl...
Miss Islington (bot) [Fri, 24 Aug 2018 04:59:16 +0000 (00:59 -0400)] 
closes bpo-34474: Python/bltinmodule.c: Add missing NULL check in builtin_sum_impl() (GH-8872)

Reported by Svace static analyzer.
(cherry picked from commit 2b824b2538c4a5f9f520c5de8a1eae5a0c181a94)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agocloses bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH...
Miss Islington (bot) [Fri, 24 Aug 2018 04:38:16 +0000 (00:38 -0400)] 
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)

Reported by Svace static analyzer.
(cherry picked from commit f6247aac08c1a79d0479145a405718bb76dba434)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agoFix doc for `add_subparsers` arguments (GH-8884)
Miss Islington (bot) [Fri, 24 Aug 2018 03:22:17 +0000 (23:22 -0400)] 
Fix doc for `add_subparsers` arguments (GH-8884)

There was a missing comma.
(cherry picked from commit cc18258daf2727a4b8d657aaf0bf8a9cb0b54bb3)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
7 years agoFix typo in asyncio.BoundedSemaphore docs (GH-8882)
Miss Islington (bot) [Fri, 24 Aug 2018 02:03:23 +0000 (22:03 -0400)] 
Fix typo in asyncio.BoundedSemaphore docs (GH-8882)

semapthores -> semaphores
(cherry picked from commit b8a181f4ae167e4eda60f585a536240764151cf7)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
7 years agobpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points...
Miss Islington (bot) [Thu, 23 Aug 2018 15:54:33 +0000 (11:54 -0400)] 
bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points (GH-8862)

The current C implementations **crash** if the input includes a surrogate
Unicode code point, which is not possible to encode in UTF-8.

Important notes:

1.  It is possible to pass a non-UTF-8 string as a separator to the
    `.isoformat()` methods.
2.  The pure-Python `datetime.fromisoformat()` implementation accepts
    strings with a surrogate as the separator.

In `datetime.fromisoformat()`, in the special case of non-UTF-8 separators,
this implementation will take a performance hit by making a copy of the
input string and replacing the separator with 'T'.

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Co-authored-by: Paul Ganssle <paul@ganssle.io>
(cherry picked from commit 096329f0b2bf5e3f0a16363aa631d993ce078737)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
7 years agoMake it more clear that setUpClass runs before each class, not "class run" (GH-8844)
Miss Islington (bot) [Thu, 23 Aug 2018 15:02:46 +0000 (11:02 -0400)] 
Make it more clear that setUpClass runs before each class, not "class run" (GH-8844)

(cherry picked from commit c33bb5d4016fb2fc8f3b6d4b0c14b73b33cdb3cf)

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
7 years agobpo-34207: Fix pymain_read_conf() for UTF-8 Mode (GH-8868) (GH-8870)
Victor Stinner [Thu, 23 Aug 2018 10:41:35 +0000 (12:41 +0200)] 
bpo-34207: Fix pymain_read_conf() for UTF-8 Mode (GH-8868) (GH-8870)

bpo-34170, bpo-34207: pymain_read_conf() now sets Py_UTF8Mode to
config->utf8_mode. pymain_read_conf() calls indirectly
Py_DecodeLocale() and Py_EncodeLocale() which depend on Py_UTF8Mode.

(cherry picked from commit 89487f51b8d6ba8a55f5de0ed689e46fefe73cc9)

7 years agobpo-34436: Fix check that disables overallocation for the last fmt specifier (GH...
Miss Islington (bot) [Thu, 23 Aug 2018 08:03:02 +0000 (04:03 -0400)] 
bpo-34436: Fix check that disables overallocation for the last fmt specifier (GH-8826)

Reported by Svace static analyzer.
(cherry picked from commit ccd99752675042bd5f67d332c5b0ed85ba1f2da3)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agobpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852)
Miss Islington (bot) [Wed, 22 Aug 2018 05:54:46 +0000 (01:54 -0400)] 
bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852)

Reported by Svace static analyzer.
(cherry picked from commit 28853a249b1d0c890b7e9ca345290bb8c1756446)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agobpo-34456: pickle: Add missing NULL check to save_global(). (GH-8851)
Miss Islington (bot) [Wed, 22 Aug 2018 05:54:33 +0000 (01:54 -0400)] 
bpo-34456: pickle: Add missing NULL check to save_global(). (GH-8851)

Reported by Svace static analyzer.
(cherry picked from commit f8c06b028036e50596e75d4c9f6b27ba05133efe)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agobpo-34400: Fix more undefined behavior in parsetok.c (GH-8833)
Miss Islington (bot) [Tue, 21 Aug 2018 03:23:15 +0000 (23:23 -0400)] 
bpo-34400: Fix more undefined behavior in parsetok.c (GH-8833)

(cherry picked from commit 3e26e42c905852394fa136f1cc564dac98b56166)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years agobpo-34441: Fix ABC.__subclasscheck__ crash on classes with invalid __subclasses__...
Miss Islington (bot) [Mon, 20 Aug 2018 20:42:18 +0000 (16:42 -0400)] 
bpo-34441: Fix ABC.__subclasscheck__ crash on classes with invalid __subclasses__ (GH-8835)

The missing NULL check was reported by Svace static analyzer.
(cherry picked from commit cdbf50cba1664f72ae6621a89c324a32fea70377)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
7 years agobpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5...
Miss Islington (bot) [Mon, 20 Aug 2018 14:48:31 +0000 (10:48 -0400)] 
bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744)

(cherry picked from commit 4c8555773a801f957297132a92c0acb382d640e4)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
7 years agobpo-34435: Add missing NULL check to unicode_encode_ucs1(). (GH-8823) 8829/head 8830/head
Miss Islington (bot) [Sun, 19 Aug 2018 20:17:53 +0000 (16:17 -0400)] 
bpo-34435: Add missing NULL check to unicode_encode_ucs1(). (GH-8823)

Reported by Svace static analyzer.
(cherry picked from commit 74a307d48ef8b278c4629ca0ef2139be1c9a34e6)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
7 years agobpo-22057: Clarify eval() documentation (GH-8812)
Miss Islington (bot) [Sun, 19 Aug 2018 10:29:50 +0000 (06:29 -0400)] 
bpo-22057: Clarify eval() documentation (GH-8812)

If a globals dictionary without a '__builtins__' key is passed to
eval(), a '__builtins__' key will be inserted to the dictionary:

    >>> eval("print('__builtins__' in globals())", {})
    True

(As a result of this behavior, we can use the builtins
print() and globals() even if we passed a dictionary without a
'__builtins__' key to eval().)
(cherry picked from commit 225b05548027d55aafb11b65f6a4a2bef2f5196f)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
7 years agobpo-34415: Updated logging.Formatter docstring. (GH-8811) (GH-8817)
Miss Islington (bot) [Sun, 19 Aug 2018 07:20:13 +0000 (03:20 -0400)] 
bpo-34415: Updated logging.Formatter docstring. (GH-8811) (GH-8817)

(cherry picked from commit d3d3171da895d8cb880f23fae6be778f0ac23be7)

7 years agobpo-34432: doc Mention complex and decimal.Decimal on str.format note about locales...
Miss Islington (bot) [Sat, 18 Aug 2018 18:16:36 +0000 (14:16 -0400)] 
bpo-34432: doc Mention complex and decimal.Decimal on str.format note about locales (GH-8808) (GH-8809)

(cherry picked from commit 93b5655c040a33f9ba4cdbd303afc8398c8413c7)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agobpo-34381: refer to 'Running & Writing Tests' in README.rst (GH-8797)
Miss Islington (bot) [Fri, 17 Aug 2018 21:57:41 +0000 (17:57 -0400)] 
bpo-34381: refer to 'Running & Writing Tests' in README.rst (GH-8797)

(cherry picked from commit cae8ff93a696aa7d74562a9eeaf27afac1f181b4)

Co-authored-by: Michael Osipov <1983-01-06@gmx.net>
7 years agobpo-34418: Fix HTTPErrorProcessor documentation (GH-8793)
Miss Islington (bot) [Fri, 17 Aug 2018 10:02:08 +0000 (06:02 -0400)] 
bpo-34418: Fix HTTPErrorProcessor documentation (GH-8793)

The http_response() and https_response() methods of the HTTPErrorProcessor
class have two required parameters, 'request' and 'response'.
(cherry picked from commit c53aaec793e018edef4e72a3edbd338b10db10aa)

Co-authored-by: Sebastian Rittau <srittau@rittau.org>
7 years ago[3.7] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787) (GH-8789)
Miss Islington (bot) [Thu, 16 Aug 2018 19:37:20 +0000 (15:37 -0400)] 
[3.7] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787) (GH-8789)

Read from data socket to avoid "[SSL] shutdown while in init" exception
during shutdown of the dummy server.

Signed-off-by: Christian Heimes <christian@python.org>
<!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) -->
https://bugs.python.org/issue34391
<!-- /issue-number -->
(cherry picked from commit 1590c393360df059160145e7475754427bfc6680)

Co-authored-by: Christian Heimes <christian@python.org>
7 years agobpo-34217: Use lowercase for windows headers (GH-8472)
Miss Islington (bot) [Thu, 16 Aug 2018 07:29:20 +0000 (03:29 -0400)] 
bpo-34217: Use lowercase for windows headers (GH-8472)

(cherry picked from commit e6a4755e6793942b950c1595e0c34bd66a0ee13e)

Co-authored-by: Erik Janssens <erik.janssens@conceptive.be>
7 years agobpo-34395: Fix memory leaks caused by incautious usage of PyMem_Resize(). (GH-8756)
Miss Islington (bot) [Thu, 16 Aug 2018 04:53:00 +0000 (00:53 -0400)] 
bpo-34395: Fix memory leaks caused by incautious usage of PyMem_Resize(). (GH-8756)

(cherry picked from commit 67b9cc8e6072a919d2ed7e7ecc8124c8acfb3733)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
7 years agobpo-34405: Updated to OpenSSL 1.1.0i for Windows builds. (GH-8775)
Miss Islington (bot) [Wed, 15 Aug 2018 20:55:10 +0000 (16:55 -0400)] 
bpo-34405: Updated to OpenSSL 1.1.0i for Windows builds. (GH-8775)

(cherry picked from commit 864a892af38afefb0a0464af298cf09d2e1195f7)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
7 years agocloses bpo-34400: Fix undefined behavior in parsetok(). (GH-4439)
Miss Islington (bot) [Wed, 15 Aug 2018 06:51:12 +0000 (02:51 -0400)] 
closes bpo-34400: Fix undefined behavior in parsetok(). (GH-4439)

Avoid undefined pointer arithmetic with NULL.
(cherry picked from commit 7c4ab2afb17b99eb3f61f9c73cbd548b5e0ad2c0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years agobpo-34399: 2048 bits RSA keys and DH params (GH-8762) (GH-8763)
Miss Islington (bot) [Tue, 14 Aug 2018 14:52:27 +0000 (10:52 -0400)] 
bpo-34399: 2048 bits RSA keys and DH params (GH-8762) (GH-8763)

Downstream vendors have started to deprecate weak keys. Update all RSA keys
and DH params to use at least 2048 bits.

Finite field DH param file use RFC 7919 values, generated with

    certtool --get-dh-params --sec-param=high

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 88bfd0bce05043f658e50addd21366f317995e35)

Co-authored-by: Christian Heimes <christian@python.org>
7 years agosmtplib documentation fixes (GH-8708)
Miss Islington (bot) [Mon, 13 Aug 2018 04:06:22 +0000 (21:06 -0700)] 
smtplib documentation fixes (GH-8708)

* SMTP.startssl: Fix doc on keyfile and certfile use

* SMTP.startssl: Add missing keyfile and certfile deprecation notice

* SMTP: Doc grammar fixes
(cherry picked from commit da12063f2f53b7d272824863ed24260cefb22e8c)

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
7 years agobpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452)
Miss Islington (bot) [Mon, 13 Aug 2018 03:32:44 +0000 (20:32 -0700)] 
bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452)

(cherry picked from commit 4d12e4dc28b7c782c368bae2e8fd3815167ed37d)

Co-authored-by: Vadim Pushtaev <pushtaev.vm@gmail.com>
7 years agoFix misindented yaml in logging how to example (GH-8604)
Miss Islington (bot) [Mon, 13 Aug 2018 00:04:44 +0000 (17:04 -0700)] 
Fix misindented yaml in logging how to example (GH-8604)

(cherry picked from commit 10b59f1b019cd00c940dd7f4a74c4f667a20f25f)

Co-authored-by: Rémy HUBSCHER <hubscher.remy@gmail.com>
7 years agoFix the versionadded indentation in exec_module doc (GH-8719)
Miss Islington (bot) [Sun, 12 Aug 2018 07:01:21 +0000 (00:01 -0700)] 
Fix the versionadded indentation in exec_module doc (GH-8719)

(cherry picked from commit 65b5ef02ec1f44e3a19b689a1ecf73d01c82161b)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agobpo-34379: Doc: Move note for json.dump (GH-8730)
Miss Islington (bot) [Sat, 11 Aug 2018 08:02:03 +0000 (01:02 -0700)] 
bpo-34379: Doc: Move note for json.dump (GH-8730)

(cherry picked from commit 9e840848510d20e644a19c723b803877377d3765)

Co-authored-by: Evan Allrich <eallrich@gmail.com>
7 years agocloses bpo-34377: Update Valgrind suppressions. (GH-8729)
Miss Islington (bot) [Sat, 11 Aug 2018 07:29:32 +0000 (00:29 -0700)] 
closes bpo-34377: Update Valgrind suppressions. (GH-8729)

Valgrind isn't seeing PyObject_Free/PyObject_Realloc, but using _PyObject_Free/_PyObject_Realloc works.
(cherry picked from commit db6075ab3aa44f69c13c4a169806d08596d25003)

Co-authored-by: Paul Price <price@astro.princeton.edu>
7 years agobpo-26818: Add a test to make sure the bug is fixed (GH-8664)
Miss Islington (bot) [Sat, 11 Aug 2018 06:28:34 +0000 (23:28 -0700)] 
bpo-26818: Add a test to make sure the bug is fixed (GH-8664)

The main cause of this bug was fixed as part of bpo-31908.
(cherry picked from commit c8b0dbc4928a1fe4bd5abebd810b6849374c7af3)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
7 years agobpo-34333: Fix %-formatting in Path.with_suffix() (GH-8663)
Miss Islington (bot) [Sat, 11 Aug 2018 06:00:11 +0000 (23:00 -0700)] 
bpo-34333: Fix %-formatting in Path.with_suffix() (GH-8663)

(cherry picked from commit 423d05f6f59b24c91b9ef6b2e4ac130316764382)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
7 years agobpo-34047: IDLE: fix mousewheel scrolling direction on macOS (GH-8678)
Miss Islington (bot) [Fri, 10 Aug 2018 06:43:06 +0000 (23:43 -0700)] 
bpo-34047: IDLE: fix mousewheel scrolling direction on macOS (GH-8678)

(cherry picked from commit 077059e0f086cf8c8b7fb9d1f053e38ddc743f59)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
7 years agoDoc: add missing capture_output arg to subprocess.run() signature (GH-8374)
Miss Islington (bot) [Thu, 9 Aug 2018 22:03:52 +0000 (15:03 -0700)] 
Doc: add missing capture_output arg to subprocess.run() signature (GH-8374)

(cherry picked from commit 22d131a7f9e4e64486da1d1cddbfed2379517791)

Co-authored-by: Andriy Maletsky <9919211+and800@users.noreply.github.com>
7 years agoImprove grammar of asynchronous iterator glossary entry (GH-8657)
Miss Islington (bot) [Thu, 9 Aug 2018 16:08:49 +0000 (09:08 -0700)] 
Improve grammar of asynchronous iterator glossary entry (GH-8657)

(cherry picked from commit cf2c5e8e2867e41d34079b2e464bbbe653fb7981)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agobpo-34324: Doc README wrong directory name for venv (GH-8650)
Miss Islington (bot) [Thu, 9 Aug 2018 15:10:27 +0000 (08:10 -0700)] 
bpo-34324: Doc README wrong directory name for venv (GH-8650)

In the documentation, the `env` directory is specified when we execute
the `make venv` command. But in the code, `make venv` will create the
virtualenv inside the `venv` directory (defined by `VENVDIR`)
(cherry picked from commit 599bfa18f8ebcb23af300b6855934048c3c64e7d)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
7 years agoMake code examples in Functional Programming HOWTO to be PEP 8 compliant. (GH-8646)
Miss Islington (bot) [Tue, 7 Aug 2018 21:56:25 +0000 (14:56 -0700)] 
Make code examples in Functional Programming HOWTO to be PEP 8 compliant. (GH-8646)

(cherry picked from commit db8707c8ab57d9454c838586c08199c82a3d74d9)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
7 years agobpo-34335: Use async/await syntax in documentation examples (GH-8674)
Miss Islington (bot) [Tue, 7 Aug 2018 20:33:31 +0000 (13:33 -0700)] 
bpo-34335: Use async/await syntax in documentation examples (GH-8674)

(cherry picked from commit d2ac400267940f35d731d66c2dafafe099d770d9)

Co-authored-by: Mikhail Terekhov <termim@gmail.com>
7 years agoVSTS: Skip build steps when only docs have changed (GH-8546)
Miss Islington (bot) [Tue, 7 Aug 2018 15:18:03 +0000 (08:18 -0700)] 
VSTS: Skip build steps when only docs have changed (GH-8546)

(cherry picked from commit b221c93d4cf8fe9ecec429b08612abcc211a39a6)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
7 years agobpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)
Miss Islington (bot) [Tue, 7 Aug 2018 02:37:38 +0000 (19:37 -0700)] 
bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)

(cherry picked from commit e4dcbbd7f4ac18d01c0ec85f64ae98b8281ed403)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
7 years agoFix HTML formatting in datamodel.rst (GH-8693)
Miss Islington (bot) [Mon, 6 Aug 2018 21:12:37 +0000 (14:12 -0700)] 
Fix HTML formatting in datamodel.rst (GH-8693)

(cherry picked from commit 3c1b590472d567e22a607ba31271865cd90c8e9b)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
7 years agobpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)
Miss Islington (bot) [Mon, 6 Aug 2018 19:59:43 +0000 (12:59 -0700)] 
bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)

Patch by Terry Jan Reedy.
(cherry picked from commit 5b2657fb8c5aaa98e5748e1c325c74b97ea12fd1)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
7 years agobpo-34272: Move argument parsing tests from test_capi to test_getargs2. (GH-8567)
Miss Islington (bot) [Mon, 6 Aug 2018 14:11:04 +0000 (07:11 -0700)] 
bpo-34272: Move argument parsing tests from test_capi to test_getargs2. (GH-8567)

(cherry picked from commit 8f7bb100d0fa7fb2714f3953b5b627878277c7c6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agobpo-34273: Change 'Fixed point' to 'Fixed-point notation'. (GH-8673)
Miss Islington (bot) [Mon, 6 Aug 2018 12:47:36 +0000 (05:47 -0700)] 
bpo-34273: Change 'Fixed point' to 'Fixed-point notation'. (GH-8673)

* bpo-34273: Change 'Fixed point' to 'Fixed-point notation'.
The change in the mini language floating point and decimal table
is consistent with 'Exponential notation' and clarifies that we
are referring to the output notation, not an object type.

* Update string.rst

* Update string.rst

* Update string.rst

* Update string.rst
(cherry picked from commit 28c7f8c8ce34a0cb848822a252a9d0a761fb42d5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
7 years agobpo-19891: Ignore error while writing history file (GH-8483)
Miss Islington (bot) [Mon, 6 Aug 2018 09:03:43 +0000 (02:03 -0700)] 
bpo-19891: Ignore error while writing history file (GH-8483)

(cherry picked from commit b2499669ef2e6dc9a2cdb49b4dc498e078167e26)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
7 years agobpo-34336: Don't promote possibility to leave out typing.Optional (GH-8677)
Miss Islington (bot) [Sun, 5 Aug 2018 17:36:04 +0000 (10:36 -0700)] 
bpo-34336: Don't promote possibility to leave out typing.Optional (GH-8677)

(cherry picked from commit 336c945858055059a65134d4c501a85037d70d99)

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
7 years ago[3.7] bpo-34247: Fix Python 3.7 initialization (#8659)
Victor Stinner [Sun, 5 Aug 2018 10:31:59 +0000 (12:31 +0200)] 
[3.7] bpo-34247: Fix Python 3.7 initialization (#8659)

* -X dev: it is now possible to override the memory allocator using
  PYTHONMALLOC even if the developer mode is enabled.
* Add _Py_InitializeFromConfig()
* Add _Py_Initialize_ReadEnvVars() to set global configuration
  variables from environment variables
* Fix the code to initialize Python: Py_Initialize() now also reads
  environment variables
* _Py_InitializeCore() can now be called twice: the second call
  only replaces the configuration.
* Write unit tests on Py_Initialize() and the different ways to
  configure Python
* The isolated mode now always sets Py_IgnoreEnvironmentFlag and
  Py_NoUserSiteDirectory to 1.
* pymain_read_conf() now saves/restores the configuration
  if the encoding changed

7 years agobpo-33839: refactor IDLE's tooltips & calltips, add docstrings and tests (GH-7683)
Miss Islington (bot) [Sun, 5 Aug 2018 06:47:28 +0000 (23:47 -0700)] 
bpo-33839: refactor IDLE's tooltips & calltips, add docstrings and tests (GH-7683)

* make CallTip and ToolTip sub-classes of a common abstract base class
* remove ListboxToolTip (unused and ugly)
* greatly increase test coverage
* tested on Windows, Linux and macOS
(cherry picked from commit 87e59ac11ee074b0dc1bc864c74fac0660b27f6e)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
7 years agoFix reST markup in unittest documentation (GH-8665)
Miss Islington (bot) [Fri, 3 Aug 2018 22:13:52 +0000 (15:13 -0700)] 
Fix reST markup in unittest documentation (GH-8665)

(cherry picked from commit 2e5566d9e774dcde81e8139b486730917816e045)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
7 years agobpo-34329: Doc'd how to remove suffix of pathlib.Path() (GH-8655)
Miss Islington (bot) [Fri, 3 Aug 2018 21:45:46 +0000 (14:45 -0700)] 
bpo-34329: Doc'd how to remove suffix of pathlib.Path() (GH-8655)

(cherry picked from commit 46dc4e34ed8005a688d7f3512844ef227a3465f4)

Co-authored-by: Stefan Otte <stefan.otte@gmail.com>
7 years agoFix docstring of Profiler class (GH-8651)
Miss Islington (bot) [Fri, 3 Aug 2018 09:30:49 +0000 (02:30 -0700)] 
Fix docstring of Profiler class (GH-8651)

(cherry picked from commit 2ebd3813af9172fe1f9b2f6004edf6f1e1e5d9f1)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
7 years agoImprove the grammar in `range` documentation. (GH-8628)
Miss Islington (bot) [Fri, 3 Aug 2018 06:16:07 +0000 (23:16 -0700)] 
Improve the grammar in `range` documentation. (GH-8628)

Remove unnecessary "that" in the sentence.
(cherry picked from commit b6efc2cf9701adfb901eec2fe6a418893739877a)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
7 years agobpo-34275: Make IDLE calltips always visible on Mac. (GH-8639)
Miss Islington (bot) [Fri, 3 Aug 2018 03:39:36 +0000 (20:39 -0700)] 
bpo-34275: Make IDLE calltips always visible on Mac.  (GH-8639)

Some MacOS-tk combinations need .update_idletasks().
The call is both unneeded and innocuous on Linux and Windows.
Patch by Kevin Waltzer.
(cherry picked from commit 9beaef6225cdae972b1cccd5310828cc29bf9d33)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
7 years agobpo-34317: Fix a dead url to Windows documentation (GH-8622)
Miss Islington (bot) [Fri, 3 Aug 2018 03:29:39 +0000 (20:29 -0700)] 
bpo-34317: Fix a dead url to Windows documentation (GH-8622)

(cherry picked from commit 46ebe61c7f3511b97268b44d5373a9e9cf0b5cc7)

Co-authored-by: HiyashiChuka <41299525+hiyashichuka@users.noreply.github.com>
7 years agoUpdate list.remove(x) documentation (GH-8636)
Miss Islington (bot) [Fri, 3 Aug 2018 03:03:19 +0000 (20:03 -0700)] 
Update list.remove(x) documentation (GH-8636)

Rephrase it to "It raises a `ValueError`"
(cherry picked from commit bcd1d971b66f529cbd450aca438275b868031605)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
7 years agobpo-30317: Fix multiprocessing test_timeout() (GH-8621)
Miss Islington (bot) [Fri, 3 Aug 2018 00:26:57 +0000 (17:26 -0700)] 
bpo-30317: Fix multiprocessing test_timeout() (GH-8621)

Multiprocessing test_timeout() now accepts a delta of 100 ms instead
of just 50 ms, since the test failed with 135.8 ms instead of the
expected 200 ms.
(cherry picked from commit 5640d030e100aade54210034828b711c3b506b18)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
7 years agobpo-27910: Update documentation of traceback module (GH-6116)
Miss Islington (bot) [Thu, 2 Aug 2018 16:51:48 +0000 (09:51 -0700)] 
bpo-27910: Update documentation of traceback module (GH-6116)

In the documentation for the traceback module, the definitions of functions
extract_tb(), format_list() and classmethod StackSummary.from_list()
mention the old style 4-tuples that these functions used to return or accept.

Since Python 3.5, however, they return or accept a FrameSummary object
instead of a 4-tuple, or a StackSummary object instead of a list of 4-tuples.

Co-authored-by: torsava <torsava@redhat.com>
Co-Authored-By: Berker Peksag <berker.peksag@gmail.com>
(cherry picked from commit f394ee5eaf6d6d8f45e0478e77d4dbff25c6bea7)

7 years agobpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)
Miss Islington (bot) [Thu, 2 Aug 2018 07:52:22 +0000 (00:52 -0700)] 
bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)

(cherry picked from commit dd74369cb7b230b07ac3a031563406c8f2aae17f)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
7 years agobpo-34120: fix IDLE freezing after closing dialogs (GH-8603)
Miss Islington (bot) [Thu, 2 Aug 2018 06:37:50 +0000 (23:37 -0700)] 
bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)

Added missing .grab_release() calls to all places where we call .grab_set().
(cherry picked from commit 10ea9409ceb5da83cb380b610750551e26561044)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
7 years ago[3.7] bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532)...
Miss Islington (bot) [Tue, 31 Jul 2018 15:29:07 +0000 (08:29 -0700)] 
[3.7] bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532) (GH-8586)

7 years agobpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)
Miss Islington (bot) [Tue, 31 Jul 2018 09:20:06 +0000 (02:20 -0700)] 
bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)

* Fix integer overflow in os.readv(), os.writev(), os.preadv()
  and os.pwritev() and in os.sendfile() with headers or trailers
  arguments (on BSD-based OSes and MacOS).

* Fix sending the part of the file in os.sendfile() on MacOS.
  Using the trailers argument could cause sending more bytes from
  the input file than was specified.

Thanks Ned Deily for testing on 32-bit MacOS.
(cherry picked from commit 9d5727326af53ddd91016d98e16ae7cf829caa95)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years ago[3.7] bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346) (GH-8581)
Serhiy Storchaka [Tue, 31 Jul 2018 07:22:44 +0000 (10:22 +0300)] 
[3.7] bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346) (GH-8581)

* help(hashlib) didn't work because of incorrect module name in blake2b and
  blake2s classes.
* Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly
  accepted keyword argument "string" for binary data, but documented as
  accepting the "data" keyword argument. Now this parameter is positional-only.
* Keyword-only parameters in blake2b() and blake2s() were not documented as
  keyword-only.
* Default value for some parameters of blake2b() and blake2s() was None,
  which is not acceptable value.
* The length argument for shake_*.digest() was wrapped out to 32 bits.
* The argument for shake_128.digest() and shake_128.hexdigest() was not
  positional-only as intended.
* TypeError messages for incorrect arguments in all constructors sha3_*(),
  shake_*() and keccak_*() incorrectly referred to sha3_224.

Also made the following enhancements:

* More accurately specified input and result types for strings, bytes and
  bytes-like objects.
* Unified positional parameter names for update() and constructors.
* Improved formatting.
(cherry picked from commit f1d36d8efaecd5c84cb35e35119b283f37d83c40)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agoRevert "closes bpo-27494: Fix 2to3 handling of trailing comma after a generator expre...
Miss Islington (bot) [Tue, 31 Jul 2018 06:52:49 +0000 (23:52 -0700)] 
Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a generator expression (GH-3771)" (GH-8241)

This reverts commit af810b35b494ef1d255d4bf340b92a9dad446995.

This is not valid syntax (see bpo-32012).
(cherry picked from commit 4b8a7f51da224d1a0ad8159935f78ba4e6e16037)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agobpo-27671: Update FAQ about why len is function (GH-8432)
Miss Islington (bot) [Tue, 31 Jul 2018 05:54:25 +0000 (22:54 -0700)] 
bpo-27671: Update FAQ about why len is function (GH-8432)

(cherry picked from commit c48e26dcadbff8620bb5881d3bd148fc8894d0ef)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
7 years agobpo-33833: Fix ProactorSocketTransport AssertionError (GH-7893)
Miss Islington (bot) [Mon, 30 Jul 2018 20:04:30 +0000 (13:04 -0700)] 
bpo-33833: Fix ProactorSocketTransport AssertionError (GH-7893)

(cherry picked from commit 9045199c5aaeac9b52537581be127d999b5944ee)

Co-authored-by: twisteroid ambassador <twisteroidambassador@users.noreply.github.com>
7 years agoUse 'for example' instead of 'in other words' in compound statement doc (GH-8401)
Miss Islington (bot) [Mon, 30 Jul 2018 19:30:31 +0000 (12:30 -0700)] 
Use 'for example' instead of 'in other words' in compound statement doc (GH-8401)

(cherry picked from commit 6921ef7bef4eab3819b3d0fda5fa3e3b2a8c0613)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>