Commit Graph

101189 Commits

Author SHA1 Message Date
Berker Peksag a0a42d22d8
Fix a reference to the MRE book in re docs (GH-1113)
Reported by Maksym Nikulyak on docs.p.o.
2018-03-23 16:46:52 +03:00
Serhiy Storchaka 397466dfd9
bpo-30953: Improve error messages and add tests for jumping (GH-6196)
into/out of an except block.
2018-03-23 14:46:45 +02:00
Serhiy Storchaka 702f8f3611
bpo-33041: Rework compiling an "async for" loop. (#6142)
* Added new opcode END_ASYNC_FOR.
* Setting global StopAsyncIteration no longer breaks "async for" loops.
* Jumping into an "async for" loop is now disabled.
* Jumping out of an "async for" loop no longer corrupts the stack.
* Simplify the compiler.
2018-03-23 14:34:35 +02:00
INADA Naoki c65bf3fe4a
bpo-32999: ast: Convert useless check to assert (GH-6197) 2018-03-23 18:19:34 +09:00
Eric V. Smith 56970b8ce9
bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, but doesn't have a type annotation. (GH-6192)
If a dataclass has a member variable that's of type Field, but it doesn't have a type annotation, raise TypeError.
2018-03-22 16:28:48 -04:00
INADA Naoki f757b72b25
bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189)
bpo-33018 (GH-5944) fixed bpo-32999 too.  So fc7df0e6 is not required
anymore.  Revert it except test case.
2018-03-22 21:52:42 +09:00
jab 40472dd42d bpo-33018: Improve issubclass() error checking and message. (GH-5944)
This improves error message for situations when a non-class is
checked w.r.t. an abstract base class.
2018-03-22 11:26:06 +00:00
Donald Stufft d93b5161af
Upgrade pip to v9.0.3 and setuptools to v39.0.1 (#6184) 2018-03-21 22:47:44 -04:00
Eric V. Smith 8e4560a9da
Add 'Field' to dataclasses.__all__. (GH-6182)
- Add missing 'Field' to __all__.
- Improve tests to catch this.
2018-03-21 17:10:22 -04:00
Thomas Moreau dec1c7786f FIX failure on OSX sem_getvalue (#6180) 2018-03-21 18:56:27 +01:00
Thomas Moreau e2f33add63 bpo-33078 - Fix queue size on pickling error (GH-6119) 2018-03-21 16:50:28 +01:00
Zackery Spytz 9308dea3e1 Fix typos in mmap() error messages (GH-6173) 2018-03-21 14:02:37 +08:00
Eric V. Smith 8f6eccdc64
bpo-32896: Fix error when subclassing a dataclass with a field that uses a default_factory (GH-6170)
Fix the way that new annotations in a class are detected.
2018-03-20 22:00:23 -04:00
Xiang Zhang 10b134a07c
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.
2018-03-21 08:25:13 +08:00
Cheryl Sabella 5609b78392 bpo-18802: Add more details to ipaddress documentation (GH-6083)
Original patch by Jon Foster and Berker Peksag.
2018-03-21 08:09:15 +08:00
Cheryl Sabella 4be79f2946 bpo-28247: Document Windows executable creation in zipapp (GH-6158) 2018-03-20 22:23:19 +00:00
Matt Eaton 2cb4661707 bpo-33034: Improve exception message when cast fails for {Parse,Split}Result.port (GH-6078) 2018-03-20 09:41:37 +03:00
Eric V. Smith 7389fd935c
bpo-33100: Dataclasses now handles __slots__ and default values correctly. (GH-6152)
If the class has a member that's a MemberDescriptorType, it's not a default value, it's from that member being in __slots__.
2018-03-19 21:07:51 -04:00
aetracht 4573820d2a bpo-33061: Add missing 'NoReturn' to __all__ in typing.py (GH-6127) 2018-03-19 18:41:32 +00:00
Eric V. Smith f199bc655e
bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (#6147)
If a non-dataclass derives from a frozen dataclass, allow attributes to be set.
Require either all of the dataclasses in a class hierarchy to be frozen, or all non-frozen.
Store `@dataclass` parameters on the class object under `__dataclass_params__`. This is needed to detect frozen base classes.
2018-03-18 20:40:34 -04:00
xdegaye 3fe33043ee bpo-19417: Add test_bdb.py (GH-5217) 2018-03-18 13:02:47 -07:00
Jelle Zijlstra f64aae46da Revert "bpo-30406: Make async and await proper keywords (#1669)" (GH-6143)
This reverts commit ac317700ce.

(Reverts only the lib2to3 part.)
2018-03-18 09:54:33 -07:00
Serhiy Storchaka fe2bbb1869
bpo-32489: Allow 'continue' in 'finally' clause. (GH-5822) 2018-03-18 09:56:52 +02:00
Serhiy Storchaka 134cb01cda
bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951) 2018-03-18 09:55:53 +02:00
Serhiy Storchaka bc300ce205
bpo-33041: Add tests for jumps in/out of 'async with' blocks. (#6110) 2018-03-18 09:53:08 +02:00
Aviv Palivoda bbf7bb7a63 bpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)
It was actually fixed in SQLite 3.8.8, not 3.8.7.
2018-03-18 03:48:55 +03:00
Donald Stufft 7f81bb2add
Update pip to 9.0.2 and setuptools to 38.6.1 (#6133) 2018-03-17 11:13:48 -04:00
Marcel Plch c2b0b12d1a 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.
2018-03-17 15:41:20 +10:00
Zackery Spytz d6e1404661 bpo-33021: Fix GCC 7 warning (-Wmaybe-uninitialized) in mmapmodule.c (#6117) 2018-03-14 21:08:01 +01:00
Łukasz Langa 74f56878cd
lib2to3: Add more tests (#6101) 2018-03-13 10:53:22 -07:00
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