Commit Graph

42866 Commits

Author SHA1 Message Date
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
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
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
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
Ł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
Ł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
Antoine Pietri 019f5b3e9e bpo-22674: fix test_strsignal on OSX (GH-6085) 2018-03-12 20:03:14 +01: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
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
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
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 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
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
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
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 74382a3f17 bpo-32857: Raise error when tkinter after_cancel() is called with None. (GH-5701) 2018-03-04 12:41:47 +02: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
Serhiy Storchaka b21d155f57
bpo-32964: Reuse a testing implementation of the path protocol in tests. (#5930) 2018-03-02 11:53:51 +02:00
Eric V. Smith 5da8cfb838
Fixed incorrect default value for dataclass unsafe_hash. (GH-5949) 2018-03-01 08:01:41 -05:00
Cheryl Sabella f0daa880a4 bpo-32940: IDLE: Simplify StringTranslatePseudoMapping in pyparse (GH-5862)
The new code also runs faster.
2018-02-28 17:23:58 -05:00
Terry Jan Reedy 0954c9e9c8
bpo-30928: Update idlelib/NEWS.txt, possibly for 3.7.0b2 (GH-5932) 2018-02-27 18:36:21 -05:00