Commit Graph

40416 Commits

Author SHA1 Message Date
Nick Coghlan 944368e1cc Issue #23722: Initialize __class__ from type.__new__()
The __class__ cell used by zero-argument super() is now initialized
from type.__new__ rather than __build_class__, so class methods
relying on that will now work correctly when called from metaclass
methods during class creation.

Patch by Martin Teichmann.
2016-09-11 14:45:49 +10:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) fc3f7d5677 Remove the debug print that i accidentally left in. 2016-09-10 20:39:50 -07:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) 3a95f45a38 Remove the debug print that i accidentally left in. 2016-09-10 20:39:36 -07:00
Serhiy Storchaka cc66a6528d Backported tests for issue #28070. 2016-09-11 01:39:51 +03:00
Serhiy Storchaka d65cd091e9 Issue #28070: Fixed parsing inline verbose flag in regular expressions. 2016-09-11 01:39:01 +03:00
Christian Heimes 99a6570295 Issue #19500: Add client-side SSL session resumption to the ssl module. 2016-09-10 23:44:53 +02:00
Christian Heimes d04863771b Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.
The deprecation include manual creation of SSLSocket and certfile/keyfile
(or similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib.

ssl.wrap_socket() is not marked as deprecated yet.
2016-09-10 23:23:33 +02:00
Christian Heimes 358cfd426c Issue 28043: SSLContext has improved default settings
The options OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE, OP_NO_SSLv2 (except for PROTOCOL_SSLv2), and OP_NO_SSLv3 (except for PROTOCOL_SSLv3) are set by default. The initial cipher suite list contains only HIGH ciphers, no NULL ciphers and MD5 ciphers (except for PROTOCOL_SSLv2).
2016-09-10 22:43:48 +02:00
Terry Jan Reedy 70360194c7 IDLE newx items. merge from 3.5 2016-09-10 16:28:01 -04:00
Terry Jan Reedy d92cecb9f1 IDLE newx items. 2016-09-10 16:24:54 -04:00
Steve Dower c5111b5b1f Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd files 2016-09-10 12:25:07 -07:00
Steve Dower 109bc3aa73 Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd files 2016-09-10 12:19:42 -07:00
Steve Dower 81994006f5 Merge from 3.5 2016-09-10 11:53:34 -07:00
Steve Dower f028d9f71a Issue #27932: Backs out change 2016-09-10 11:52:18 -07:00
Serhiy Storchaka b0d497c072 Issue #24693: Changed some RuntimeError's in the zipfile module to more
appropriate types. Improved some error messages and debugging output.
2016-09-10 21:28:07 +03:00
Xavier de Gaye b32e869eb1 Issue #28046: Fix get_sysconfigdata_name(). 2016-09-10 16:19:45 +02:00
Martin Panter b61ede4ba2 Merge spelling fixes from 3.5 2016-09-10 10:44:12 +00:00
Martin Panter 99e843b48e Correct spelling in documentation and code comment 2016-09-10 10:38:28 +00:00
Victor Stinner 0fc55a234f test_platform: Save/restore os.environ on Windows 2016-09-10 06:24:47 -04:00
Nick Coghlan b161562f72 Issue #17909: Accept binary input in json.loads
json.loads (and hence json.load) now support binary input
encoded as UTF-8, UTF-16 or UTF-32.

Patch by Serhiy Storchaka.
2016-09-10 20:16:18 +10:00
Nick Coghlan 457fc9a69e Issue #27137: align Python & C implementations of functools.partial
The pure Python fallback implementation of functools.partial
now matches the behaviour of its accelerated C counterpart for
subclassing, pickling and text representation purposes.

Patch by Emanuel Barry and Serhiy Storchaka.
2016-09-10 20:00:02 +10:00
Victor Stinner eddc4b7272 Merge 3.5 (regrtest) 2016-09-10 04:27:56 -04:00
Victor Stinner c7a070e998 regrtest: accept options after test names 2016-09-10 04:27:28 -04:00
Victor Stinner c50cccfcc3 test_eintr: Fix ResourceWarning warnings 2016-09-10 04:19:48 -04:00
Serhiy Storchaka 8f9cafad3d Issue #28019: itertools.count() no longer rounds non-integer step in range
between 1.0 and 2.0 to 1.
2016-09-10 09:53:51 +03:00
Serhiy Storchaka 8ddcf3abf7 Issue #28019: itertools.count() no longer rounds non-integer step in range
between 1.0 and 2.0 to 1.
2016-09-10 09:49:24 +03:00
Victor Stinner bc6262675c Issue #18401: Fix test_pdb on Windows
* Use "with Popen" to cleanup properly the process
* Use support.temp_cwd() to properly change the working directory
* Use environ.pop() to cleanup the code
2016-09-09 23:22:09 -07:00
Victor Stinner 11ea04491d Issue #18401: Fix test_pdb if $HOME is not set
HOME is not set on Windows for example.

Use also textwrap.dedent() for the script.
2016-09-09 22:56:54 -07:00
Łukasz Langa 2eb6eca3e5 Issue #18401: pdb tests don't read ~/.pdbrc anymore
Patch by Martin Matusiak and Sam Kimbrel.
2016-09-09 22:21:17 -07:00
Victor Stinner a1fd0789ed Try to fix sizeof unit tests on dict
Issue #28056 and issue #26058.
2016-09-09 21:51:19 -07:00
Guido van Rossum e617521b0d Use raw string for regexp 2016-09-09 21:39:10 -07:00
R David Murray b067c8fdd1 #20476: Deal with the message_factory circular import differently.
It turns out we can't depend on email.message getting imported every place
message_factory is needed, so to avoid a circular import we need to special
case Policy.message_factory=None in the parser instead of using monkey
patching.  I had a feeling that was a bad idea when I did it.
2016-09-10 00:22:25 -04:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) 28325749c0 Issue #25969: Update the lib2to3 grammar to handle the unpacking
generalizations added in 3.5.
2016-09-09 18:18:52 -07:00
Gregory P. Smith dbdf029a55 remove fix_callable - callable() was readded many releases ago. 2016-09-09 18:14:33 -07:00
Steve Dower 6a294a54de Issue #27932: Fixes memory leak in platform.win32_ver() 2016-09-09 18:01:25 -07:00
Victor Stinner 78601a38c2 Fix SystemError in compact dict
Issue #28040: Fix _PyDict_DelItem_KnownHash() and _PyDict_Pop(): convert
splitted table to combined table to be able to delete the item.

Write an unit test for the issue.

Patch by INADA Naoki.
2016-09-09 19:28:36 -07:00
Eric V. Smith 89e1b1aae0 Issue 27080: PEP 515: add '_' formatting option. 2016-09-09 23:06:47 -04:00
Łukasz Langa 04bedfa3ce Issue #27199: TarFile expose copyfileobj bufsize to improve throughput
Patch by Jason Fried.
2016-09-09 19:48:14 -07:00
Eric V. Smith 451d0e38fc Issue 27948: Allow backslashes in the literal string portion of f-strings, but not in the expressions. Also, require expressions to begin and end with literal curly braces. 2016-09-09 21:56:20 -04:00
Zachary Ware 80da993826 Issue #28046: Fix distutils
Why do we have two sysconfig modules again?
2016-09-09 18:29:10 -07:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) 3b822d6c89 Issue #25969: Update the lib2to3 grammar to handle the unpacking
generalizations added in 3.5.
2016-09-09 18:19:51 -07:00
Steve Dower 48c7d7518e Merge from Zach 2016-09-09 18:05:07 -07:00
Steve Dower 1588a3b377 Issue #27932: Fixes memory leak in platform.win32_ver() 2016-09-09 18:04:26 -07:00
Zachary Ware c4b53afce4 Issue #28046: Remove platform-specific directories from sys.path 2016-09-09 17:59:49 -07:00
Łukasz Langa a785c87d6e DTrace support: function calls, GC activity, line execution
Tested on macOS 10.11 dtrace, Ubuntu 16.04 SystemTap, and libbcc.

Largely based by an initial patch by Jesús Cea Avión, with some
influence from Dave Malcolm's SystemTap patch and Nikhil Benesch's
unification patch.

Things deliberately left out for simplicity:
- ustack helpers, I have no way of testing them at this point since
they are Solaris-specific
- PyFrameObject * in function__entry/function__return, this is
SystemTap-specific
- SPARC support
- dynamic tracing
- sys module dtrace facility introspection

All of those might be added later.
2016-09-09 17:37:37 -07:00
Steve Dower ff70fc2206 Issue #25758: Prevents zipimport from unnecessarily encoding a filename (patch by Eryk Sun) 2016-09-09 17:33:37 -07:00
Steve Dower 8dcc48ee3b Issue #25758: Prevents zipimport from unnecessarily encoding a filename (patch by Eryk Sun) 2016-09-09 17:27:33 -07:00
R David Murray 1319236167 Merge: #14977: Make mailcap respect the order of the lines in the mailcap file. 2016-09-09 20:09:43 -04:00
R David Murray 347dc95cd3 #14977: Make mailcap respect the order of the lines in the mailcap file.
This is required by RFC 1542, so despite the subtle behavior change we
are treating it as a bug.  Patch by Michael Lazar.
2016-09-09 20:04:23 -04:00
Gregory P. Smith 223f12c9eb Remove 2to3's fix_callable... We reintroduced the callable built-in
pretty early on in the 3.x series (3.1 or 3.2?).
2016-09-09 17:03:58 -07:00
Raymond Hettinger b7f3c944d1 Merge 2016-09-09 16:44:53 -07:00
Raymond Hettinger ae9e5f032d Issue #22450: Use "Accept: */*" in the default headers for urllib.request 2016-09-09 16:43:48 -07:00
Zachary Ware 5272868e1f Rename test_strlit -> test_string_literals 2016-09-09 16:15:03 -07:00
Davin Potts 5458647bb8 Issue #28053: Applying refactorings, docs and other cleanup to follow. 2016-09-09 18:03:10 -05:00
Raymond Hettinger f1024f7425 merge 2016-09-09 15:58:00 -07:00
R David Murray 06ed218ed0 #20476: add a message_factory policy attribute to email. 2016-09-09 18:39:18 -04:00
Christian Heimes 3aeacad561 Issue #28025: Convert all ssl module constants to IntEnum and IntFlags. 2016-09-10 00:19:35 +02:00
Serhiy Storchaka 142aee3a8e Merge heads 2016-09-10 01:14:38 +03:00
Serhiy Storchaka be9a4e5c85 Issue #433028: Added support of modifier spans in regular expressions. 2016-09-10 00:57:55 +03:00
Brett Cannon a721abac29 Issue #26331: Implement the parsing part of PEP 515.
Thanks to Georg Brandl for the patch.
2016-09-09 14:57:09 -07:00
Gregory P. Smith fa40ca811f issue27985 - fix the incorrect duplicate class name in the lib2to3
test.  call it TestVarAnnotations instead.
2016-09-09 14:48:08 -07:00
Guido van Rossum 7b3b3dc85d Merge asyncio upstream. 2016-09-09 14:26:31 -07:00
Eric Snow 50fd89806f Issue #24320: Drop an old setuptools-induced hack. 2016-09-09 13:30:54 -07:00
Guido van Rossum 7719d46431 Rename Future._blocking to _asyncio_future_blocking.
This is now an official "protected" API that can be used to write
classes that are duck-type-compatible with Future without subclassing
it.  (For that purpose I also changed isinstance(result, Future) to
check for this attribute instead.)

Hopefully Amber Brown can use this to make Twisted.Deferred compatible
with asyncio.Future.

Tests and docs are TBD. (Also there are more isinstance() checks to fix.)
2016-09-09 12:58:15 -07:00
Zachary Ware 724f6a67f2 Rename test_pep####.py files 2016-09-09 12:55:37 -07:00
Zachary Ware a0154c0f0e Fix running test_tokenize directly 2016-09-09 12:55:14 -07:00
Guido van Rossum 1140a03426 Rename Future._blocking to _asyncio_future_blocking.
This is now an official "protected" API that can be used to write
classes that are duck-type-compatible with Future without subclassing
it.  (For that purpose I also changed isinstance(result, Future) to
check for this attribute instead.)

Hopefully Amber Brown can use this to make Twisted.Deferred compatible
with asyncio.Future.

Tests and docs are TBD.
2016-09-09 12:54:54 -07:00
R David Murray 94a7927cc6 #28047: Fix calculation of base64 line length.
This is buggy in the old email code as well, but it doesn't affect anything
there because only the default line length is ever used there.
2016-09-09 15:00:09 -04:00
Victor Stinner f9b760f48a Rework CALL_FUNCTION* opcodes
Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more
efficient bytecode:

* CALL_FUNCTION now only accepts position arguments
* CALL_FUNCTION_KW accepts position arguments and keyword arguments, but keys
  of keyword arguments are packed into a constant tuple.
* CALL_FUNCTION_EX is the most generic, it expects a tuple and a dict for
  positional and keyword arguments.

CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW opcodes have been removed.

2 tests of test_traceback are currently broken: skip test, the issue #28050 was
created to track the issue.

Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka
and Victor Stinner.
2016-09-09 10:17:08 -07:00
Steve Dower 2a2becc1d1 Merge with 3.5 2016-09-09 12:09:07 -07:00
Eric Snow 06aed90a1f Issue #27576: Fix call order in OrderedDict.__init__(). 2016-09-09 11:59:08 -07:00
Zachary Ware cce02f8b82 Remove Lib/test/test_pep247.py
This test file is a holdover from the days before hashlib, and doesn't seem to
have anything of value in it.
2016-09-09 11:38:38 -07:00
Yury Selivanov d04e417b1e tests: use subTest in test_unparse.test_files 2016-09-09 11:14:59 -07:00
Yury Selivanov 52c4e7cc84 Issue #28008: Implement PEP 530 -- asynchronous comprehensions. 2016-09-09 10:36:01 -07:00
Steve Dower 41519b2ca8 Issue #26513: Fixes platform module detection of Windows Server 2016-09-09 09:46:56 -07:00
Guido van Rossum 6cff8744a0 Issue #27999: Make "global after use" a SyntaxError, and ditto for nonlocal.
Patch by Ivan Levkivskyi.
2016-09-09 09:36:26 -07:00
Steve Dower 7bcf7931fc Issue #26513: Fixes platform module detection of Windows Server 2016-09-09 09:47:09 -07:00
Steve Dower 6d5cf8a73e Fixes expected error when getting encoding while shutting down. 2016-09-09 09:21:01 -07:00
Steve Dower 4db86bc1b4 Changes pyvenv.cfg trick into an actual sys.path file. 2016-09-09 09:17:35 -07:00
Donald Stufft 783c9ef84d Merge 3.5 2016-09-09 12:15:07 -04:00
Donald Stufft 6bde454f9e Merge 3.4 2016-09-09 12:14:43 -04:00
Donald Stufft 16d7d5941d Upgrade setuptools to 27.1.2 2016-09-09 12:08:53 -04:00
Guido van Rossum deed5a18ca Issue #28038: Remove Tools/parser/com2ann.py and its unit test.
Development is moving to https://github.com/ilevkivskyi/com2ann
2016-09-09 09:06:11 -07:00
Steve Dower 18591e4189 Revert #27959: ImportError within an encoding module should also skip the encoding 2016-09-09 08:56:37 -07:00
Donald Stufft 722b685dc1 Merge 3.5 2016-09-09 11:36:59 -04:00
Donald Stufft 621333d227 Merge 3.4 2016-09-09 11:35:43 -04:00
Donald Stufft d25d9dc1fc Upgrade setuptools to 27.1.1 2016-09-09 11:35:02 -04:00
Martin Panter 2b9b70b43b Issue #27106: Add test for configparser.__all__
Patch by Jacek Kołodziej. The Error class is deliberately omitted because it
is a generic name and of limited use.
2016-09-09 06:46:48 +00:00
Yury Selivanov eb6364557f Issue #28003: Implement PEP 525 -- Asynchronous Generators. 2016-09-08 22:01:51 -07:00
Victor Stinner b96ef55d49 regrtest: log FS and locale encodings 2016-09-08 21:46:56 -07:00
Yury Selivanov f8cb8a16a3 Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.
Patch by Ivan Levkivskyi.
2016-09-08 20:50:03 -07:00
R David Murray f03bcfd168 Merge: #27630: Be consistent in how _XXX/_encoded_XXX vars are initialized. 2016-09-08 22:27:39 -04:00
R David Murray eaab1ca558 #27630: Be consistent in how _XXX/_encoded_XXX vars are initialized. 2016-09-08 22:21:27 -04:00
Eric Snow 4f29e75289 Issue #24254: Drop cls.__definition_order__. 2016-09-08 15:11:11 -07:00
R David Murray 301edfa579 Add policy keyword to email.generator.DecodedGenerator. 2016-09-08 17:57:06 -04:00
Raymond Hettinger 4c483ad52b Merge 2016-09-08 14:45:40 -07:00
Raymond Hettinger 262b6793e0 Issue #26020: Fix evaluation order for set literals 2016-09-08 14:40:36 -07:00
Steve Dower 33df0c3fb6 More lenient skipping of console tests. 2016-09-08 14:36:18 -07:00
Steve Dower f09e2fa2e9 Skips console open_fd tests when we don't have real consoles. 2016-09-08 14:34:24 -07:00
Senthil Kumaran 10427f4485 [merge from 3.5] - Issue28010 - Make http.client.HTTPConnection.putrequest
documentation consistent with the code.
2016-09-08 14:29:23 -07:00