Commit Graph

993 Commits

Author SHA1 Message Date
Miss Islington (bot) 72c34cf6dd
closes bpo-31903: Release the GIL when calling into SystemConfiguration (GH-4178)
(cherry picked from commit 4859ba0d2c)

Co-authored-by: Max Bélanger <aeromax@gmail.com>
2018-09-12 08:37:30 -07:00
Benjamin Peterson cadb66e173
[3.7] closes bpo-25041: Document AF_PACKET socket address format. (GH-9207)
(cherry picked from commit 731ff68eee)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-09-11 18:46:36 -07:00
Miss Islington (bot) d8bc7a666b
closes bpo-31902: Fix the col_offset attribute for ast.Async* nodes to point to the "async" keyword. (GH-4175)
Previously, col_offset points to the keyword after "async".
(cherry picked from commit 90fc8980bb)

Co-authored-by: guoci <zguoci@gmail.com>
2018-09-11 15:21:11 -07:00
Miss Islington (bot) 536e45accf
closes bpo-31608: Fix a crash in methods of a subclass of _collections.deque with a bad __new__(). (GH-3788)
(cherry picked from commit 24bd50bdcc)

Co-authored-by: Oren Milman <orenmn@gmail.com>
2018-09-11 12:08:10 -07:00
Miss Islington (bot) 3e648f8371
bpo-28617 Fixed docs inaccuracies about the types that support membership tests (GH-9086)
<!-- issue-number: [bpo-28617](https://www.bugs.python.org/issue28617) -->
https://bugs.python.org/issue28617
<!-- /issue-number -->
(cherry picked from commit 08bcf647d8)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
2018-09-11 11:13:33 -07:00
Miss Islington (bot) 3235fac0d7 bpo-34405: Update to OpenSSL 1.1.0i for macOS installer builds (GH-9166) (GH-9167)
(cherry picked from commit 3102e24d83)

Co-authored-by: Ned Deily <nad@python.org>
2018-09-11 09:07:11 -07:00
Miss Islington (bot) 2bc4eea8f6
bpo-34625: Update vendorized expat version to 2.2.6. (GH-9150)
(cherry picked from commit 5033aa77aa)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-09-10 21:55:27 -07:00
Miss Islington (bot) 9c4a63fc17 bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242) (GH-9148)
When subprocess.Popen() stdin= stdout= or stderr= handles are specified
and appear in pass_fds=, don't close the original fds after dup'ing them.

This implementation and unittest primarily came from @izbyshev (see the PR)

See also b89b52f284

This also removes the old manual p2cread, c2pwrite, and errwrite closing logic
as inheritable flags and _close_open_fds takes care of that properly today without special treatment.

This code is within child_exec() where it is the only thread so there is no
race condition between the dup and _Py_set_inheritable_async_safe call.
(cherry picked from commit ce34410b8b)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
2018-09-10 21:36:20 -07:00
Miss Islington (bot) 037582eb7f
bpo-33460: remove ellipsis that look like continuation prompts (GH-7851)
Remove ellipsis that look like continuation prompts,
has a side benefit of putting rest of error message in proper text color.
(cherry picked from commit f019579828)

Co-authored-by: Lew Kurtz <37632626+lew18@users.noreply.github.com>
2018-09-10 18:49:39 -07:00
orlnub123 c0d63bf73b [3.7] bpo-34282: Fix Enum._convert method shadowing members named _convert (GH-9034)
* Fix Enum._convert shadowing members named _convert
2018-09-10 09:39:48 -07:00
Miss Islington (bot) 4902017430
bpo-34588: Fix an off-by-one error in traceback formatting. (GH-9077)
The recursive frame pruning code always undercounted the number of elided frames
by one. That is, in the "[Previous line repeated N more times]" message, N would
always be one too few. Near the recursive pruning cutoff, one frame could be
silently dropped. That situation is demonstrated in the OP of the bug report.

The fix is to start the identical frame counter at 1.
(cherry picked from commit d545869d08)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-09-10 09:00:08 -07:00
Tal Einat d53f1cabe8
[3.7] bpo-34621: fix uuid.UUID (un)pickling compatbility with older Python versions (<3.7) (GH-9133) 2018-09-10 18:47:29 +03:00
William Grzybowski 7a633ed79c [3.7] bpo-34604: Fix possible mojibake in pwd.getpwnam() and grp.getgrnam() (GH-9098) (GH-9104)
Pass the user/group name as Unicode to the formatting function,
instead of always decoding a bytes string from UTF-8..
(cherry picked from commit 28658485a5)

Co-authored-by: William Grzybowski <wg@FreeBSD.org>
2018-09-09 13:27:31 +02:00
Miss Islington (bot) 77b92b15a5
bpo-34421 avoid unicode error in distutils logging (GH-8799)
This caused installation errors in some cases on Windows.
Patch by Julien Malard.
(cherry picked from commit 0afada163c)

Co-authored-by: Julien Malard <julien.malard@mail.mcgill.ca>
2018-09-08 13:52:59 -07:00
Miss Islington (bot) 9835696ec4
bpo-34246: Use no mutable default args in smtplib (GH-8554)
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls.
(cherry picked from commit d5fbe9b1a3)

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2018-09-07 15:29:27 -07:00
Zackery Spytz 18d7dff1bb [3.7] bpo-34594: Don't hardcode errno values in the tests. (GH-9094)
(cherry picked from commit b03c2c5190)
2018-09-07 09:17:32 -07:00
Miss Islington (bot) f862f3abae
bpo-25750: fix refcounts in type_getattro() (GH-6118)
When calling tp_descr_get(self, obj, type), make sure that
we own a strong reference to "self".
(cherry picked from commit 8f735485ac)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
2018-09-07 00:50:35 -07:00
Miss Islington (bot) 2d3f2dc9f8 bpo-34542: Update test certs and keys (GH-8997) (GH-9007)
Update all test certs and keys to use future proof crypto settings:

* 3072 bit RSA keys
* SHA-256 signature

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e6dac00779)
2018-09-06 15:13:24 +02:00
Miss Islington (bot) 5b17d7fccd
closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. (GH-9067)
(cherry picked from commit 874809ea38)

Co-authored-by: Erik Janssens <erik.janssens@conceptive.be>
2018-09-04 23:45:03 -07:00
Miss Islington (bot) e8ca8806a9 bpo-34563: Fix for invalid assert on big output of multiprocessing.Process (GH-9027) (GH-9064)
Fix for invalid assert on big output of multiprocessing.Process.
(cherry picked from commit 266f4904a2)

Co-authored-by: Alexander Buchkovsky <olex.buchkovsky@gmail.com>
2018-09-04 21:39:54 +02:00
Miss Islington (bot) 7aa3eadca2
bpo-34530: Fix distutils find_executable() (GH-9049)
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
(cherry picked from commit 39487196c8)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-09-04 05:19:13 -04:00
Miss Islington (bot) 4c532da120
closes bpo-34555: Fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H (GH-9016)
(cherry picked from commit 2d7102e726)

Co-authored-by: Thomas Herzog <thomas@mcduke.net>
2018-09-01 18:30:44 -04:00
Miss Islington (bot) 89c9043ee0
bpo-34558: Add missing parentheses in _aix.py (GH-9017)
p.wait()
(cherry picked from commit 172a71f19b)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2018-08-31 22:46:32 -04:00
Miss Islington (bot) 5df3658f2d
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 aada63b20e)

Co-authored-by: Brendan Gerrity <brerrity@gmail.com>
2018-08-31 11:32:22 -04:00
Victor Stinner 0b9ea4b211
[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 315877dc36)
2018-08-29 11:01:33 +02:00
Victor Stinner 65ef7425a3
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 5cb258950c)
2018-08-28 13:51:20 +02:00
Miss Islington (bot) 2cf33161f7
bpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)
(cherry picked from commit 216b745eaf)

Co-authored-by: Przemysław Spodymek <przemyslaw@spodymek.com>
2018-08-27 18:37:18 -04:00
Miss Islington (bot) 55b8c4bff8
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 89d79b1449)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2018-08-26 20:32:48 -04:00
Miss Islington (bot) 80e9fedcf5
bpo-34171: Prevent creating Lib/trace.cover when run the trace module. (GH-8841)
(cherry picked from commit c406d5cd74)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-08-25 03:47:22 -04:00
Miss Islington (bot) d5f017bbd6
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 76be0fffff)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-08-25 01:53:00 -04:00
Miss Islington (bot) 3e6020c4dd
bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks (GH-8864)
(cherry picked from commit 91cb298f81)

Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
2018-08-24 10:44:47 -04:00
Miss Islington (bot) 89b1654e0b
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 096329f0b2)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
2018-08-23 11:54:33 -04:00
Miss Islington (bot) d1f0ccc7e6
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 cdbf50cba1)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-08-20 16:42:18 -04:00
Miss Islington (bot) 870247a57e [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 1590c39336)


Co-authored-by: Christian Heimes <christian@python.org>
2018-08-16 21:37:20 +02:00
Miss Islington (bot) 64336dc0a5
bpo-34405: Updated to OpenSSL 1.1.0i for Windows builds. (GH-8775)
(cherry picked from commit 864a892af3)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-08-15 16:55:10 -04:00
Miss Islington (bot) 2275b773eb
closes bpo-34400: Fix undefined behavior in parsetok(). (GH-4439)
Avoid undefined pointer arithmetic with NULL.
(cherry picked from commit 7c4ab2afb1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-08-15 02:51:12 -04:00
Miss Islington (bot) e3228a3f44 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 88bfd0bce0)

Co-authored-by: Christian Heimes <christian@python.org>
2018-08-14 16:52:27 +02:00
Miss Islington (bot) 32e58fc321
bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452)
(cherry picked from commit 4d12e4dc28)

Co-authored-by: Vadim Pushtaev <pushtaev.vm@gmail.com>
2018-08-12 20:32:44 -07:00
Miss Islington (bot) 39c1253bd1
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 db6075ab3a)

Co-authored-by: Paul Price <price@astro.princeton.edu>
2018-08-11 00:29:32 -07:00
Miss Islington (bot) c614121224 bpo-34333: Fix %-formatting in Path.with_suffix() (GH-8663)
(cherry picked from commit 423d05f6f5)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-08-11 09:00:11 +03:00
Miss Islington (bot) ea8835fb30
bpo-34047: IDLE: fix mousewheel scrolling direction on macOS (GH-8678)
(cherry picked from commit 077059e0f0)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-08-09 23:43:06 -07:00
Miss Islington (bot) 5799e5a84c bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)
(cherry picked from commit e4dcbbd7f4)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-08-07 05:37:38 +03:00
Miss Islington (bot) 416f3435c5
bpo-19891: Ignore error while writing history file (GH-8483)
(cherry picked from commit b2499669ef)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2018-08-06 02:03:43 -07:00
Victor Stinner 0c90d6f759
[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
2018-08-05 12:31:59 +02:00
Miss Islington (bot) e65ec491fb
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 87e59ac11e)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-08-04 23:47:28 -07:00
Miss Islington (bot) ffd6364745
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 9beaef6225)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-08-02 20:39:36 -07:00
Miss Islington (bot) d9fc795487
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 10ea9409ce)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-08-01 23:37:50 -07:00
Miss Islington (bot) 172a81e42b [3.7] bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532) (GH-8586) 2018-07-31 11:29:07 -04:00
Miss Islington (bot) 3e4b688759
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 9d5727326a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-31 02:20:06 -07:00
Serhiy Storchaka 47957dab94
[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 f1d36d8efa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-31 10:22:44 +03:00