Commit Graph

98997 Commits

Author SHA1 Message Date
Miss Islington (bot) c8698cff7c bpo-27212: Modify islice recipe to consume initial values preceding start (GH-6195) (GH-6267)
(cherry picked from commit da1734c58d)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-26 19:24:02 -07:00
Miss Islington (bot) 57db13e582
bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)
bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr.

When redirecting, subprocess attempts to achieve the following state:
each fd to be redirected to is less than or equal to the fd
it is redirected from, which is necessary because redirection
occurs in the ascending order of destination descriptors.
It fails to do so in a couple of corner cases,
for example, if 1 is redirected to 2 and 0 is closed in the parent.
(cherry picked from commit 0e7144b064)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-26 13:43:46 -07:00
Miss Islington (bot) a413a91949
Fix description about SimpleXMLRPCServer constructor parameter bind_and_activate. (GH-776)
Passing True as the `bind_and_activate` *do* immediately opening and binding to their socket.
(cherry picked from commit e6223579c8)

Co-authored-by: cocoatomo <cocoatomo77@gmail.com>
2018-03-26 05:20:25 -07:00
Miss Islington (bot) 80af7320e7
Gitignore gmon.out (GH-5796)
gmon.out is generated when profiling turned on

Full Configuration:
./configure --prefix=$PWD/install --enable-profiling  --enable-big-digits=30
--with-pydebug --with-assertions  --with-valgrind
(cherry picked from commit 95ad3822a2)

Co-authored-by: Neeraj Badlani <neerajbadlani@gmail.com>
2018-03-26 04:53:51 -07:00
Miss Islington (bot) f86b0984d0
Fix typo and edit for clarity in the docstrings of sys.float_info. (GH-2251)
(cherry picked from commit 0301c9bdd1)

Co-authored-by: Stefano Taschini <taschini@users.noreply.github.com>
2018-03-26 03:57:37 -07:00
Miss Islington (bot) 45116d393f
bpo-33096: Fix ttk.Treeview.insert. (GH-6228)
Allow ttk.Treeview.insert to insert iid that has a false boolean value.
Note iid=0 and iid=False would be same.
(cherry picked from commit 3ab44c0783)

Co-authored-by: Garvit Khatri <garvitdelhi@gmail.com>
2018-03-26 01:20:10 -07:00
Christian Heimes f5befbb0d1
[3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210) (GH-6214)
LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
LibreSSL < 2.7.

Documentation updates and fixes for failing tests will be provided in
another patch set.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-03-24 18:38:14 +01:00
Miss Islington (bot) 643a781188
bpo-27428: Fix WindowsRegistryFinder documentation to list appropriate ABC (GH-6061)
(cherry picked from commit 5cbb84106e)

Co-authored-by: Himanshu Lakhara <himanshulakhara1947@gmail.com>
2018-03-23 14:50:09 -07:00
Miss Islington (bot) fce39ab1c8 Fix a reference to the MRE book in re docs (GH-1113)
Reported by Maksym Nikulyak on docs.p.o.
(cherry picked from commit a0a42d22d8)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-03-23 18:55:46 +03:00
Serhiy Storchaka 18d7edf32e
[3.6] bpo-33041: Fixed jumping if the function contains an "async for" loop. (GH-6154). (GH-6199)
(cherry picked from commit b9744e924c)
2018-03-23 15:45:37 +02:00
Miss Islington (bot) 560ea272b0 Upgrade pip to v9.0.3 and setuptools to v39.0.1 (GH-6184)
(cherry picked from commit d93b5161af)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-03-21 23:50:50 -04:00
Miss Islington (bot) 7abf34344f
Fix typos in mmap() error messages (GH-6173)
(cherry picked from commit 9308dea3e1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-03-21 00:07:23 -07:00
Miss Islington (bot) ae2feb32e7
bpo-27683: Fix a regression for host() of ipaddress network objects (GH-6016)
The result of host() was not empty when the network is constructed by a tuple containing an
integer mask and only 1 bit left for addresses.
(cherry picked from commit 10b134a07c)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-20 18:49:41 -07:00
Miss Islington (bot) 481cbe8d62
bpo-18802: Add more details to ipaddress documentation (GH-6083)
Original patch by Jon Foster and Berker Peksag.
(cherry picked from commit 5609b78392)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-20 17:59:00 -07:00
Miss Islington (bot) 47a0e64ccf
bpo-28247: Document Windows executable creation in zipapp (GH-6158)
(cherry picked from commit 4be79f2946)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-20 15:52:41 -07:00
Miss Islington (bot) f3e6eadbcf [3.6] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6160)
fstat may block for long time if the file descriptor is on a
non-responsive NFS server, hanging all threads. Most fstat() calls are
handled by _Py_fstat(), releasing the GIL internally, but but
_Py_fstat_noraise() does not release the GIL, and most calls release the
GIL explicitly around it.

This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs
when calling:
- mmap.mmap()
- os.urandom()
- random.seed()
(cherry picked from commit 4484f9dca9)

Co-authored-by: Nir Soffer <nirsof@gmail.com>
2018-03-20 20:40:18 +01:00
xdegaye 424f3dafea bpo-19417: Add test_bdb.py (GH-5217)
(cherry picked from commit 3fe33043ee)
2018-03-19 10:30:47 -07:00
Serhiy Storchaka 193760f00a
[3.6] bpo-33041: Add tests for jumps in/out of 'async with' blocks. (GH-6110). (GH-6141)
(cherry picked from commit bc300ce205)
2018-03-18 12:32:32 +02:00
Miss Islington (bot) 5bd0fe6a00 Update pip to 9.0.2 and setuptools to 38.6.1 (GH-6133) (#6136)
(cherry picked from commit 7f81bb2add)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-03-17 12:19:41 -04:00
Miss Islington (bot) 1da0479f68
bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)
Multi-phase initialized modules allow m_traverse to be called while the
module is still being initialized, so module authors may need to account
for that.
(cherry picked from commit c2b0b12d1a)

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
2018-03-16 23:29:30 -07:00
Miss Islington (bot) a954919788 [3.6] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (GH-5772) (#6104)
Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
(cherry picked from commit 5affd5c29e)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2018-03-14 18:52:22 +01:00
Christian Heimes 0ec0290a07
bpo-30622: Fix backport of NPN fix (#6102)
Fix backport a79591cf of bpo-30622 to 3.6 branch.

Signed-off-by: Christian Heimes <christian@python.org>
2018-03-14 07:40:20 +01:00
Ned Deily 4d04cae921 on to 3.6.6 2018-03-13 23:38:19 -04:00
Ned Deily 973c5db73b Python 3.6.5rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAlqoeW8ACgkQLTR+pqpl
 Qh2uLg/9FfFExO/PmCJ+7p9nkpxeRid/Q1h9UplRMnrqVH3wNMY+uk3/jvV1p6lq
 a3knYf+PqXVQz/LpWhpCOjZlqQgYZoe0CeISzk2XyRUY9W6ZMteEWiqxLclOSVAq
 SxLaNV6qtDdKfuHUu2M7778CVmpG3D6gWY3yjWv1seGMtffxWJlzsD95q/9UFare
 NHMEjHfnLtg8VCB2Utr2FTXlAFA9x87URJM4ZUaSzyaxRzDtVvyL/zuLaGimuIbm
 f8HEckKM9UlJxcFU7KXJSZSczm+an0C6ReAr8h8XkOO14uGHt0rjw15mvNSuggTb
 SkDC4N/IMMy4lYi1fmYJ5EY81KZW1SPF71b4RlybkX4/64CEWIsCz/Y1I3m+xKHI
 7TfAp85PmC++h5+sczzP0EtY6NpMwTBkbDsJI9pyP3KVZUoTET481YPPXTnS73te
 thB78FLQuyvmr9Q/I61YcB81mQlHngj9WgyIWlb73TLhs0UMbEYOKPp8Lvp5IONI
 u/CFZYVnAlzS9QMOSSZusRATvWWMat23CdeAqPQmxgjxi/ioMuM0pZpA6mhnGJRo
 hPfh2Ggwq8N78aFzW0UQtjftylWafuGmePPI5MClS2+rzbCLi8VqUEHnvRvKV9aV
 bMsK7+rU6E7GUhKdSC16nEn7/Ao1Bi+35MaPrTBOXZVRI1ph8F4=
 =7FeD
 -----END PGP SIGNATURE-----

Merge tag 'v3.6.5rc1' into 3.6
2018-03-13 23:22:42 -04:00
Ned Deily f03c5148cf 3.6.5rc1 2018-03-13 21:21:36 -04:00
Ned Deily 94552448d7 bpo-32726: macOS installer changes for 3.6.5
Backport the new 10.9+ installer variant from 3.7.  This variant features
more modern options; like 64-bit only (Apple is deprecating 32-bit support
in future macOS releases); a built-in version of Tcl/Tk 8.6.8; built with
clang rather than gcc-4.2.  For 3.6.5, the 10.9+ variant will be offered
as an additional alternative to the traditional 10.6+ variant in earlier
3.6.x releases.  Binary extension modules (including wheels) built for
earlier versions of 3.6.x with the 10.6 variant should continue to work
with either 3.6.5 variant without recompilation.

In addition, both installer variants have updated 3rd-party libraries:
OpenSSL 1.0.2m -> 1.0.2n
XZ 5.2.2 -> 5.2.3
SQLite 3.21.0 -> 3.22.0

Also the 10.6 variant now sets CC=gcc instead of CC=gcc-4.2 and does not
search for the outdated 10.6 SDK.  The variant is built with the same
compiler as before.  As before, for extension module builds, the CC can
be overridden with the CC env variable and an SDK can be specified
with the SDKROOT env variable (see man xcrun).  These minor changes
should be transparent to nearly all users.
2018-03-13 21:01:08 -04:00
Miss Islington (bot) cad3eb2026 lib2to3: Add more tests (GH-6101) (#6109)
(cherry picked from commit 74f56878cd)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-03-13 11:47:32 -07:00
Miss Islington (bot) cf61a81f1d
[3.7] bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-5928)
(cherry picked from commit e32bbaf376)

Co-authored-by: xdegaye <xdegaye@gmail.com>
2018-03-13 03:12:16 -07:00
Miss Islington (bot) 6a526f6738 bpo-33064: lib2to3: support trailing comma after *args and **kwargs (GH-6096) (#6098)
New tests also added.

I also made the comments in line with the builtin Grammar/Grammar. PEP 306 was
withdrawn, Kees Blom's railroad program has been lost to the sands of time for
at least 16 years now (I found a python-dev post from people looking for it).
(cherry picked from commit b51f5de711)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-03-13 01:32:28 -07:00
Antoine Pitrou 069b8d20be
[3.6] bpo-31804: Fix multiprocessing.Process with broken standard streams (GH-6079) (GH-6081)
In some conditions the standard streams will be None or closed in the child process (for example if using "pythonw" instead of "python" on Windows).  Avoid failing with a non-0 exit code in those conditions.

Report and initial patch by poxthegreat..
(cherry picked from commit e756f66c83)
2018-03-11 20:09:20 +01:00
Miss Islington (bot) 20ac11a9fb [3.6] bpo-33026: Fix jumping out of "with" block by setting f_lineno. (GH-6026). (GH-6074) (GH-6075)
(cherry picked from commit 26c9f565d0)
(cherry picked from commit 04aadf23ea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-11 10:21:13 +02:00
Miss Islington (bot) 3f439d14ad bpo-33045: Fix typos in SSL documentation (GH-6065)
(cherry picked from commit 9cf8c42f32)

Co-authored-by: Matt Eaton <agnosticdev@gmail.com>
2018-03-11 04:26:01 +03:00
Miss Islington (bot) d0826340d9
[3.7] bpo-33041: Add missed error checks when compile "async for" (GH-6053) (GH-6060)
and remove redundant code.
(cherry picked from commit 67ee07795b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 9e94c0d3c7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-10 11:32:49 -08:00
Andrew Svetlov 017e9fda92
[3.6] bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044) (GH-6058)
* Skip write()/data_received() if sslpipe is destroyed.
(cherry picked from commit 5e80a71ab6)
2018-03-10 19:09:07 +02:00
Miss Islington (bot) de8567e38c
bpo-26701: Improve documentation for the rounding special methods. (GH-6054)
(cherry picked from commit 496431ffb6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-10 07:55:13 -08:00
Miss Islington (bot) 1028ca4f04 bpo-26701: Add documentation for __trunc__ (GH-6050)
`int` fails back to `__trunc__` is `__int__` isn't defined, so cover
that in the docs.
(cherry picked from commit 308eab979d)

Co-authored-by: Eric Appelt <eric.appelt@gmail.com>
2018-03-11 01:10:45 +10:00
Miss Islington (bot) 19b42fe97c Warn that compile() can crash when compiling to an AST object (GH-6043) (GH-6046)
(cherry picked from commit f7a6ff6fca)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
2018-03-09 13:40:39 -08:00
Miss Islington (bot) b316c44b01 bpo-32758: Warn that ast.parse() and ast.literal_eval() can segfault the interpreter (GH-5960) (GH-6042)
(cherry picked from commit 7a7f100eb3)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
2018-03-09 12:35:14 -08:00
Miss Islington (bot) 3f7d0b69f2
controlflow: Use full example for "5 through 9" (GH-5907)
Replace example result of "5 through 9" with complete list: "5, 6, 7, 8, 9".
This format is more consistent with the surrounding examples.
(cherry picked from commit 83d7062d2d)

Co-authored-by: Steven M. Vascellaro <S.Vascellaro@gmail.com>
2018-03-09 12:11:30 -08:00
Nathan Henrie 12f74d8608 bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037)
test_asyncio hangs indefinitely on macOS 10.13.2+ on `read_pty_output()`
using the KqueueSelector. Closing `proto.transport` (as is done in
`write_pty_output()`) seems to fix it.
2018-03-09 12:43:45 -05:00
Steve Dower 32efcd1306
bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6032) 2018-03-08 14:50:30 -08:00
Miss Islington (bot) 2f3ba27185 [3.6] bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559) (GH-5954)
(cherry picked from commit 9ba3aa4d02)

Co-authored-by: Erik Bray <erik.m.bray@gmail.com>
2018-03-08 10:28:53 -05:00
Miss Islington (bot) 15425cf245
Fix some ipaddress documentation errors (GH-6021)
* fix a typo: documention -> documentation
* fix the type of IPv?Network.hostmask
* add documentation about IPv?Network.netmask
* fix IPv6Network constructor doc that extended netmasks are not supported
(cherry picked from commit e405096ea9)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-07 20:41:27 -08:00
Miss Islington (bot) 7592c0a686
bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)
(cherry picked from commit bc3f2289b9)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-06 21:46:10 -08:00
Miss Islington (bot) 387a055261
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
(cherry picked from commit 8a387219bd)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-03-06 10:48:04 -08:00
Steve Dower baa4507946
[3.6] bpo-33001: Prevent buffer overrun in os.symlink (GH-5989) (GH-5990) 2018-03-05 14:26:28 -08:00
Miss Islington (bot) 6935a51167
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
Like Python, IDLE optionally runs one startup file in the Shell window
before presenting the first interactive input prompt.  For IDLE,
option -s runs a file named in environmental variable IDLESTARTUP or
PYTHONSTARTUP; -r file runs file.  Python sets __file__ to the startup
file name before running the file and unsets it before the first
prompt.  IDLE now does the same when run normally, without the -n
option.
(cherry picked from commit 22c82be5df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-03-05 11:23:08 -08:00
Miss Islington (bot) 73a43960c7
bpo-32857: Raise error when tkinter after_cancel() is called with None. (GH-5701)
(cherry picked from commit 74382a3f17)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-04 03:42:41 -08:00
Benjamin Peterson c951675406
[3.6] bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 0e6c8ee235)
2018-03-03 22:59:12 -08:00
Miss Islington (bot) bd92cfe632
Fix missing coroutine declaration in the asyncio documentation. (GH-5964)
(cherry picked from commit 13cfd57dcf)

Co-authored-by: Joongi Kim <me@daybreaker.info>
2018-03-03 13:23:31 -08:00