Commit Graph

101159 Commits

Author SHA1 Message Date
xdegaye b8e9d6c5cd bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-6107)
(cherry picked from commit e32bbaf376)
2018-03-13 19:31:31 +02:00
Miro Hrončok 5affd5c29e bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (#5772)
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.
2018-03-13 05:56:43 -04:00
Łukasz Langa b51f5de711
bpo-33064: lib2to3: support trailing comma after *args and **kwargs (#6096)
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).
2018-03-13 00:44:49 -07:00
Ned Deily a34510a4c5
bpo-29719: Remove Date and Release field in whatsnew/3.7 and 8 (GH-6093) 2018-03-12 21:16:08 -04:00
Ned Deily 37ed6dfbbc Add macOS installer Conclusion file 2018-03-12 16:49:59 -04:00
Antoine Pietri 019f5b3e9e bpo-22674: fix test_strsignal on OSX (GH-6085) 2018-03-12 20:03:14 +01:00
Andrew Svetlov b21505e710
Fix docs markup for asyncio current_task() and all_tasks() (#6089) 2018-03-12 20:50:50 +02:00
Thomas Moreau 095ee415ce bpo-33056 FIX leaking fd in concurrent.futures.ProcessPoolExecutor (#6084) 2018-03-12 19:18:41 +02:00
Antoine Pietri 5d2a27de62 signal: add strsignal() (#6017)
Co-authored-by: Vajrasky Kok <sky.kok@speaklikeaking.com>
2018-03-12 14:42:34 +01:00
Nir Soffer 4484f9dca9 bpo-33021: Release the GIL during fstat() calls (GH-6019)
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()
2018-03-12 00:39:22 +01:00
Antoine Pitrou e756f66c83
bpo-31804: Fix multiprocessing.Process with broken standard streams (#6079)
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.
2018-03-11 19:21:38 +01:00
Siddhesh Poyarekar 9fb8415759 Drop confusing commented out code in pystrtod.c (GH-6072) 2018-03-11 17:45:10 +08:00
Serhiy Storchaka e2732d3e66
bpo-32970: Improve disassembly of the MAKE_FUNCTION instruction. (GH-5937) 2018-03-11 11:07:06 +02:00
Serhiy Storchaka 3f7e9aa2ef
bpo-32925: Optimized iterating and containing test for literal lists (GH-5842)
consisting of non-constants: `x in [a, b]` and `for x in [a, b]`.
The case of all constant elements already was optimized.
2018-03-11 10:54:47 +02:00
Serhiy Storchaka 4e2442505c
bpo-32946: Speed up "from ... import ..." from non-packages. (GH-5873) 2018-03-11 10:52:37 +02:00
Serhiy Storchaka b931bd0a2f
bpo-32338: OrderedDict import is no longer needed in re. (#4891) 2018-03-11 08:38:13 +02:00
Serhiy Storchaka 26c9f565d0
bpo-33026: Fix jumping out of "with" block by setting f_lineno. (#6026) 2018-03-11 08:32:47 +02:00
Serhiy Storchaka 51302a5fcc
bpo-32996: Improve What's New in 3.7. (#5983) 2018-03-11 03:48:14 +02:00
Matt Eaton 9cf8c42f32 bpo-33045: Fix typos in SSL documentation (GH-6065) 2018-03-11 04:00:04 +03:00
Berker Peksag 7280a4eef5
bpo-27645: Skip test_bad_target_in_transaction if SQLite == 3.8.7.1 (GH-6067) 2018-03-11 03:38:50 +03:00
Emanuele Gaifas d7aed4102d bpo-27645: Add support for native backup facility of SQLite (GH-4238) 2018-03-11 01:08:31 +03:00
Xiang Zhang c10b288f34
bpo-30249: Improve struct.unpack_from() error messages (GH-6059) 2018-03-11 02:58:52 +08:00
Serhiy Storchaka 67ee07795b
bpo-33041: Add missed error checks when compile "async for" (#6053)
and remove redundant code.
2018-03-10 18:49:26 +02:00
Serhiy Storchaka 24d3201eb7
bpo-33041: Fixed bytecode generation for "async for" with a complex target. (#6052)
A StopAsyncIteration raised on assigning or unpacking will be now propagated
instead of stopping the iteration.
2018-03-10 18:22:34 +02:00
Andrew Svetlov 5e80a71ab6
bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044)
* Skip write()/data_received() if sslpipe is destroyed
2018-03-10 17:48:35 +02:00
Serhiy Storchaka 496431ffb6
bpo-26701: Improve documentation for the rounding special methods. (#6054) 2018-03-10 17:18:32 +02:00
Eric Appelt 308eab979d bpo-26701: Add documentation for __trunc__ (GH-6022)
`int` fails back to `__trunc__` is `__int__` isn't defined, so cover
that in the docs.
2018-03-10 18:44:12 +10:00
Brett Cannon 10485ebd40
Warn that dbm.dumb.open() can crash Python (GH-6047) 2018-03-09 15:58:40 -08:00
Brett Cannon f7a6ff6fca
Warn that compile() can crash when compiling to an AST object (GH-6043) 2018-03-09 13:13:32 -08:00
Brett Cannon 7a7f100eb3
bpo-32758: Warn that ast.parse() and ast.literal_eval() can segfault the interpreter (GH-5960) 2018-03-09 12:03:22 -08:00
Steven M. Vascellaro 83d7062d2d 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.
2018-03-09 11:57:21 -08:00
Alexey Izbyshev 3b20d3454e bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (#6010) 2018-03-08 08:03:25 -08:00
Xiang Zhang 3c7ac7ea20
Add two missing error checks in hamt.c (GH-5851) 2018-03-08 13:59:46 +08:00
Xiang Zhang e405096ea9
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
2018-03-08 12:24:36 +08:00
INADA Naoki fc7df0e664
bpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002) 2018-03-07 16:27:01 +09:00
Xiang Zhang bc3f2289b9
bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988) 2018-03-07 13:05:37 +08:00
Yury Selivanov 8a387219bd
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004) 2018-03-06 12:59:45 -05:00
Victor Stinner 5d92647102
bpo-33005: Fix _PyGILState_Reinit() (#6001)
Fix a crash on fork when using a custom memory allocator (ex: using
PYTHONMALLOC env var).

_PyGILState_Reinit() and _PyInterpreterState_Enable() now use the
default RAW memory allocator to allocate a new interpreters mutex on
fork.
2018-03-06 14:31:37 +01:00
Siddhesh Poyarekar efd2bac156 Fix strncpy warning with gcc 8 (#5840)
The length in strncpy is one char too short and as a result it leads
to a build warning with gcc 8.  Comment out the strncpy since the
interpreter aborts immediately after anyway.
2018-03-06 18:34:35 +08:00
Jason R. Coombs b9650a04a8
bpo-32991: Restore expectation that inspect.getfile raises TypeError on namespace package (GH-5980)
* bpo-32991: Add test capturing expectation.

DocTestFinder.find should return an empty list for doctests in a namespace package.

* bpo-32991: Restore expectation that inspect.getfile on a namespace package raises TypeError.
2018-03-05 18:29:08 -05:00
Steve Dower 6921e73e33
bpo-33001: Prevent buffer overrun in os.symlink (GH-5989) 2018-03-05 14:26:08 -08:00
Barry Warsaw 4c19b95734
Add What's New for issues 32303 and 32305 (GH-5994) 2018-03-05 12:37:12 -08:00
Terry Jan Reedy 22c82be5df
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.
2018-03-05 11:02:46 -05:00
Cheryl Sabella 18fd892463 bpo-30147: Add re.escape changes to 3.7 What's New (GH-5978) 2018-03-04 18:06:57 -05:00
Cheryl Sabella 74382a3f17 bpo-32857: Raise error when tkinter after_cancel() is called with None. (GH-5701) 2018-03-04 12:41:47 +02:00
Thomas Nyberg 7023644e0c closes bpo-32980 Remove _PyFrame_Init (GH-5965) 2018-03-03 22:06:01 -08:00
Jamie Davis 0e6c8ee235 bpo-32981: Fix catastrophic backtracking vulns (#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>
2018-03-03 21:33:32 -08:00
Joongi Kim 13cfd57dcf Fix missing coroutine declaration in the asyncio documentation. (#5964) 2018-03-03 18:43:54 +02:00
Serhiy Storchaka b21d155f57
bpo-32964: Reuse a testing implementation of the path protocol in tests. (#5930) 2018-03-02 11:53:51 +02:00
Jon Wayne Parrott bf63e8d55f bpo-30607: Use external python-doc-theme (GH-2017) 2018-03-01 16:02:50 -05:00