summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-27240 Rewrite the email header folding algorithm. (#3488)R. David Murray2017-12-035-563/+508
| | | | | | | | | | | | | | | | | | | | | The original algorithm tried to delegate the folding to the tokens so that those tokens whose folding rules differed could specify the differences. However, this resulted in a lot of duplicated code because most of the rules were the same. The new algorithm moves all folding logic into a set of functions external to the token classes, but puts the information about which tokens can be folded in which ways on the tokens...with the exception of mime-parameters, which are a special case (which was not even implemented in the old folder). This algorithm can still probably be improved and hopefully simplified somewhat. Note that some of the test expectations are changed. I believe the changes are toward more desirable and consistent behavior: in general when (re) folding a line the canonical version of the tokens is generated, rather than preserving errors or extra whitespace.
* bpo-32137: The repr of deeply nested dict now raises a RecursionError (#4570)Serhiy Storchaka2017-12-033-3/+19
| | | | | instead of crashing due to a stack overflow. This perhaps will fix similar problems in other extension types.
* bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675)Nick Coghlan2017-12-031-0/+45
| | | | | | | | Previously, CO_NOFREE was set in the compiler, which meant it could end up being set incorrectly when code objects were created directly. Setting it in the constructor based on freevars and cellvars ensures it is always accurate, regardless of how the code object is defined.
* Add a minimal unit test for Python/frozen.c. (#2995)Neil Schemenauer2017-12-021-0/+30
| | | | | | If the marshal or bytecode formats get changed, frozen.c needs to be updated as well. It can be easy to miss this step and not doing so can cause test_importlib to crash in mysterious ways. Add an explict unit test to make it easier to track down the problem.
* Fix asyncio.streams.FlowControlMixin docstring typo. (#4578)John Chen2017-12-011-1/+1
|
* bpo-28668: test.support.requires_multiprocessing_queue is removed (GH-4560)xdegaye2017-12-012-20/+7
| | | | Skip tests with test.support.import_module('multiprocessing.synchronize') instead when the semaphore implementation is broken or missing.
* bpo-10544: Deprecate "yield" in comprehensions and generator expressions. ↵Serhiy Storchaka2017-12-012-11/+36
| | | | | | | | | | | | | | (GH-4579) The current behaviour of yield expressions inside comprehensions and generator expressions is essentially an accident of implementation - it arises implicitly from the way the compiler handles yield expressions inside nested functions and generators. Since the current behaviour wasn't deliberately designed, and is inherently confusing, we're deprecating it, with no current plans to reintroduce it. Instead, our advice will be to use a named nested generator definition for cases where this behaviour is desired.
* bpo-32072: Fix issues with binary plists. (#4455)Serhiy Storchaka2017-11-302-36/+106
| | | | | | | * Fixed saving bytearrays. * Identical objects will be saved only once. * Equal references will be load as identical objects. * Added support for saving and loading recursive data structures.
* bpo-20891: Fix PyGILState_Ensure() (#4650)Victor Stinner2017-11-301-0/+10
| | | | | | | When PyGILState_Ensure() is called in a non-Python thread before PyEval_InitThreads(), only call PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. Add an unit test in test_embed.
* bpo-28416: Break reference cycles in Pickler and Unpickler subclasses (#4080)Serhiy Storchaka2017-11-301-2/+63
| | | | with the persistent_id() and persistent_load() methods.
* Skip test_socket.test_sha256() on linux < 4.5 (#4643)Victor Stinner2017-11-301-0/+3
| | | bpo-31705.
* bpo-32101: Add PYTHONDEVMODE environment variable (#4624)Victor Stinner2017-11-303-9/+42
| | | | | | * bpo-32101: Add sys.flags.dev_mode flag Rename also the "Developer mode" to the "Development mode". * bpo-32101: Add PYTHONDEVMODE environment variable Mention it in the development chapiter.
* bpo-32121: Add most_recent_first parameter to tracemalloc.Traceback.format ↵Jesse-Bakker2017-11-294-18/+46
| | | | | | | | (#4534) * Add most_recent_first parameter to tracemalloc.Traceback.format to allow reversing the order of the frames in the output * Reversed default sorting of tracemalloc.Traceback frames * Allowed negative limit, truncating from the other side.
* bpo-32166: Drop Python 3.4 code from asyncio (#4612)Andrew Svetlov2017-11-293-131/+25
| | | | | | | | | | | | | | | | | | | | | | * Drop Python 3.4 code from asyncio * Fix notes * Add missing imports * Restore comment * Resort imports * Drop Python 3.4-3.5 specific code * Drop redunant check * Fix tests * Restore _COROUTINE_TYPES order * Remove useless code
* bpo-32030: Rework memory allocators (#4625)Victor Stinner2017-11-295-23/+96
| | | | | | | | | | | | | | | | | | | | * Fix _PyMem_SetupAllocators("debug"): always restore allocators to the defaults, rather than only caling _PyMem_SetupDebugHooks(). * Add _PyMem_SetDefaultAllocator() helper to set the "default" allocator. * Add _PyMem_GetAllocatorsName(): get the name of the allocators * main() now uses debug hooks on memory allocators if Py_DEBUG is defined, rather than calling directly malloc() * Document default memory allocators in C API documentation * _Py_InitializeCore() now fails with a fatal user error if PYTHONMALLOC value is an unknown memory allocator, instead of failing with a fatal internal error. * Add new tests on the PYTHONMALLOC environment variable * Add support.with_pymalloc() * Add the _testcapi.WITH_PYMALLOC constant and expose it as support.with_pymalloc(). * sysconfig.get_config_var('WITH_PYMALLOC') doesn't work on Windows, so replace it with support.with_pymalloc(). * pythoninfo: add _testcapi collector for pymem
* test_socket: socket.socketpair() is always available (#4634)Victor Stinner2017-11-291-2/+0
|
* bpo-32138: Skip on Android test_faulthandler tests that raise SIGSEGV (GH-4604)xdegaye2017-11-292-28/+16
| | | | Remove the test.support.requires_android_level decorator.
* bpo-32139: test_strftime does not anymore modify the locale (GH-4569)xdegaye2017-11-291-2/+4
|
* bpo-32164: Delete unused file idlelib/tabbedpages.py (#4628)Terry Jan Reedy2017-11-291-498/+0
|
* bpo-30781: Remove unused imports in idlelib.configdialog. (#4627)Terry Jan Reedy2017-11-291-4/+3
|
* bpo-32100: Delete unneeded import in idlelib.pathbrowser. (#4626)Terry Jan Reedy2017-11-291-1/+0
|
* bpo-32110: codecs.StreamReader.read(n) now returns not more than n (#4499)Serhiy Storchaka2017-11-282-5/+21
| | | | | characters/bytes for non-negative n. This makes it compatible with read() methods of other file-like objects.
* bpo-32107 - Improve MAC address calculation and fix test_uuid.py (#4600)Barry Warsaw2017-11-282-25/+72
| | | | | | | | ``uuid.getnode()`` now preferentially returns universally administered MAC addresses if available, over locally administered MAC addresses. This makes a better guarantee for global uniqueness of UUIDs returned from ``uuid.uuid1()``. If only locally administered MAC addresses are available, the first such one found is returned. Also improve internal code style by being explicit about ``return None`` rather than falling off the end of the function. Improve the test robustness.
* bpo-32155: Revert distutils.config change (#4618)Victor Stinner2017-11-281-3/+2
| | | | | Revert distutils changes of the commit 696b501cd11dc429a0f661adeb598bfaf89e4112 and remove the realm variable.
* bpo-32159: Remove tools for CVS and Subversion (#4615)Victor Stinner2017-11-282-8/+5
| | | | | | | | | | CPython migrated from CVS to Subversion, to Mercurial, and then to Git. CVS and Subversion are not more used to develop CPython. * platform module: drop support for sys.subversion. The sys.subversion attribute has been removed in Python 3.3. * Remove Misc/svnmap.txt * Remove Tools/scripts/svneol.py * Remove Tools/scripts/treesync.py
* bpo-32157: Removed explicit quotes around %r and {!r}. (#4582)Serhiy Storchaka2017-11-284-6/+6
|
* bpo-32154: Remove asyncio.windows_utils.socketpair (#4609)Victor Stinner2017-11-284-111/+7
|
* bpo-32071: Fix regression and add What's New entry (#4589)Jonas Haag2017-11-282-2/+26
| | | | | | * bpo-32071: Fix an undocumented behaviour regression * bpo-32071: Add 3.7 release note entry for unittest -k
* bpo-32046: Update 2to3 when converts operator.isCallable(obj). (#4417)Dong-hee Na2017-11-282-6/+5
|
* bpo-32155: Bugfixes found by flake8 F841 warnings (#4608)Victor Stinner2017-11-282-3/+3
| | | | | | | | | | | * distutils.config: Use the PyPIRCCommand.realm attribute if set * turtledemo: wait until macOS osascript command completes to not create a zombie process * Tools/scripts/treesync.py: declare 'default_answer' and 'create_files' as globals to modify them with the command line arguments. Previously, -y, -n, -f and -a options had no effect. flake8 warning: "F841 local variable 'p' is assigned to but never used".
* bpo-32154: Remove asyncio.selectors (#4605)Victor Stinner2017-11-289-23/+8
| | | | | | | | | | | | * Remove asyncio.selectors and asyncio._overlapped symbols from the namespace of the asyncio module * Replace "from asyncio import selectors" with "import selectors" * Replace "from asyncio import _overlapped" with "import _overlapped" asyncio.selectors was added to support Python 3.3, which doesn't have selectors in its standard library, and Python 3.4 in the same code base. Same rationale for asyncio._overlapped. Python 3.3 reached its end of life, and asyncio is no more maintained as a third party module on PyPI.
* asyncio: Remove asyncio/compat.py (#4606)Victor Stinner2017-11-287-60/+37
| | | | | | | | | | The asyncio/compat.py file was written to support Python < 3.5 and Python < 3.5.2. But Python 3.5 doesn't accept bugfixes anymore, only security fixes. There is no more need to backport bugfixes to Python 3.5, and so no need to have a single code base for Python 3.5, 3.6 and 3.7. Say hello (again) to "async" and "await", who became real keywords in Python 3.7 ;-)
* asyncio: use directly socket.socketpair() (#4597)Victor Stinner2017-11-287-36/+9
| | | | | Since Python 3.5, socket.socketpair() is also available on Windows, and so can be used directly, rather than using asyncio.windows_utils.socketpair().
* asyncio: Fix BaseSelectorEventLoopTests (#4595)Victor Stinner2017-11-271-0/+2
| | | | Currently, two tests fail with PYTHONASYNCIODEBUG=1 (or using -X dev).
* asyncio: Remove unused Future._tb_logger attribute (#4596)Victor Stinner2017-11-271-8/+1
| | | | It was only used on Python 3.3, now only Future._log_traceback is used.
* bpo-31245: asyncio: Fix typo, isistance => isinstance (#4594)Victor Stinner2017-11-271-1/+1
|
* Revert "bpo-32107 - Better merge of #4494 (#4576)" (#4593)Victor Stinner2017-11-272-89/+28
| | | This reverts commit 9522a218f7dff95c490ff359cc60e8c2af35f5c8.
* bpo-32136: Separate embedding tests from C API tests (GH-4567)Nick Coghlan2017-11-272-186/+204
| | | | | | | | | Some parts of the C API are only relevant to larger applications embedding CPython as a runtime engine. The helpers to test those APIs are already separated out into Programs/_testembed.c, this update moves the associated test cases out into their own dedicated test file.
* bpo-32107 - Better merge of #4494 (#4576)Barry Warsaw2017-11-272-28/+89
| | | | | | | | | | | | | | | | Improve UUID1 MAC address calculation and related tests. There are two bits in the MAC address that are relevant to UUID1. The first is the locally administered vs. universally administered bit (second least significant of the first octet). Physical network interfaces such as ethernet ports and wireless adapters will always be universally administered, but some interfaces --such as the interface that MacBook Pros communicate with their Touch Bars-- are locally administered. The former are guaranteed to be globally unique, while the latter are demonstrably *not* globally unique and are in fact the same on every MBP with a Touch Bar. With this bit is set, the MAC is locally administered; with it unset it is universally administered. The other bit is the multicast bit (least significant bit of the first octet). When no other MAC address can be found, RFC 4122 mandates that a random 48-bit number be generated. This randomly generated number *must* have the multicast bit set. The improvements in uuid.py include: * Preferentially return a universally administered MAC address, falling back to a locally administered address if none of the former can be found. * Improve several coding style issues, such as adding explicit returns of None, using a more readable bitmask pattern, and assuming that the ultimate fallback, random MAC generation will not fail (and propagating any exception there instead of swallowing them). Improvements in test_uuid.py include: * Always testing the calculated MAC for universal administration, unless explicitly disabled (i.e. for the random case), or implicitly disabled due to running in the Travis environment. Travis test machines have *no* universally administered MAC address at the time of this writing.
* bpo-27535: Fix memory leak with warnings ignore (#4489)Victor Stinner2017-11-272-1/+1
| | | | | | | The warnings module doesn't leak memory anymore in the hidden warnings registry for the "ignore" action of warnings filters. The warn_explicit() function doesn't add the warning key to the registry anymore for the "ignore" action.
* bpo-32089: Use default action for ResourceWarning (#4584)Victor Stinner2017-11-272-18/+5
| | | | | In development and debug mode, use the "default" action, rather than the "always" action, for ResourceWarning in the default warnings filters.
* bpo-23033: Improve SSL Certificate handling (GH-937)Mandeep Singh2017-11-262-8/+14
| | | | Wildcard is now supported in hostname when it is one and only character in the leftmost segment.
* bpo-32126: Skip asyncio test when sem_open() is not functional (GH-4559)xdegaye2017-11-261-0/+4
|
* bpo-26856: Skip test_pwd on Android until issue 32033 is fixed (GH-4561)xdegaye2017-11-251-20/+7
|
* bpo-24641: Improved error message for JSON unserializible keys. (#4364)Serhiy Storchaka2017-11-253-11/+16
| | | | | Also updated an example for default() in the module docstring. Removed quotes around type name in other error messages.
* bpo-32071: Add unittest -k option (#4496)Jonas Haag2017-11-254-14/+90
| | | | * bpo-32071: Add unittest -k option
* bpo-28334: netrc() now uses expanduser() to find .netrc file (GH-4537)Berker Peksag2017-11-252-7/+41
| | | | | Previously, netrc.netrc() was raised an exception if $HOME is not set. Authored-By: Dimitri Merejkowsky <dimitri.merejkowsky@tanker.io>
* bpo-32128: Skip test_nntplib.test_article_head_body() (#4552)Victor Stinner2017-11-251-0/+1
| | | | | The NNTP server currently has troubles with SSL, whereas we don't have the control on this server. This test blocks all CIs, so disable it until a fix can be found.
* bpo-28684: Remove useless import added by the previous commit (GH-4547)xdegaye2017-11-241-1/+0
|
* bpo-28684: asyncio tests handle PermissionError raised on binding unix ↵xdegaye2017-11-244-11/+40
| | | | | | | | | sockets (GH-4503) The test.support.skip_unless_bind_unix_socket() decorator is used to skip asyncio tests that fail because the platform lacks a functional bind() function for unix domain sockets (as it is the case for non root users on the recent Android versions that run now SELinux in enforcing mode).