summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-1439-71/+71
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* bpo-32225: Implementation of PEP 562 (#4731)Ivan Levkivskyi2017-12-149-4/+161
| | | | | Implement PEP 562: module __getattr__ and __dir__. The implementation simply updates module_getattro and module_dir.
* bpo-32302: Fix distutils bdist_wininst for CRT v142 (#4851)Victor Stinner2017-12-142-2/+4
| | | CRT v142 is binary compatible with CRT v140.
* bpo-29469: Move constant folding to AST optimizer (GH-2858)INADA Naoki2017-12-1411-3966/+4431
|
* bpo-32030: Rewrite _PyMainInterpreterConfig (#4854)Victor Stinner2017-12-148-193/+281
| | | | | | | | | | | | | | | | | | | | _PyMainInterpreterConfig now contains Python objects, whereas _PyCoreConfig contains wchar_t* strings. Core config: * Rename _PyMainInterpreterConfig_ReadEnv() to _PyCoreConfig_ReadEnv() * Move 3 strings from _PyMainInterpreterConfig to _PyCoreConfig: module_search_path_env, home, program_name. * Add _PyCoreConfig_Clear() * _PyPathConfig_Calculate() now takes core config rather than main config * _PyMainInterpreterConfig_Read() now requires also a core config Main config: * Add _PyMainInterpreterConfig.module_search_path: sys.path list * Add _PyMainInterpreterConfig.argv: sys.argv list * _PyMainInterpreterConfig_Read() now computes module_search_path
* bpo-30241: implement contextlib.AbstractAsyncContextManager (#1412)Jelle Zijlstra2017-12-145-5/+88
|
* bpo-32296: Unbreak tests on Windows (#4850)Yury Selivanov2017-12-131-4/+7
|
* bpo-32030: Add _PyPathConfig_ComputeArgv0() (#4845)Victor Stinner2017-12-135-141/+207
| | | | | | | | | | | | | | | | Changes: * Split _PySys_SetArgvWithError() into subfunctions for Py_Main(): * Create the Python list object * Set sys.argv to the list * Compute argv0 * Prepend argv0 to sys.path * Add _PyPathConfig_ComputeArgv0() * Remove _PySys_SetArgvWithError() * Py_Main() now splits the code to compute sys.argv/path0 and the code to update the sys module: add pymain_compute_argv() subfunction.
* bpo-32296: Implement asyncio.get_event_loop and _get_running_loop in C. (#4827)Yury Selivanov2017-12-135-28/+465
| | | | | | | | asyncio.get_event_loop(), and, subsequently asyncio._get_running_loop() are one of the most frequently executed functions in asyncio. They also can't be sped up by third-party event loops like uvloop. When implemented in C they become 4x faster.
* pymain_set_sys_argv() now copies argv (#4838)Victor Stinner2017-12-133-35/+88
| | | | | | | | | | bpo-29240, bpo-32030: * Rename pymain_set_argv() to pymain_set_sys_argv() * pymain_set_sys_argv() now creates of copy of argv and modify the copy, rather than modifying pymain->argv * Call pymain_set_sys_argv() earlier: before pymain_run_python(), but after pymain_get_importer(). * Add _PySys_SetArgvWithError() to handle errors
* pythoninfo: Add builtins, test.support, ... (#4840)Victor Stinner2017-12-131-1/+50
| | | | | | Collect more info from builtins, resource, test.test_socket and test.support modules. Co-Authored-By: Christian Heimes <christian@python.org>
* Fix couple typos (#4839)Andrew Svetlov2017-12-132-2/+2
|
* trivial: link updates in documentation (#2765)jimmy2017-12-134-5/+5
|
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-1327-178/+593
| | | | | | | | | | | | | | | | | | | | | | * Add -X utf8 command line option, PYTHONUTF8 environment variable and a new sys.flags.utf8_mode flag. * If the LC_CTYPE locale is "C" at startup: enable automatically the UTF-8 mode. * Add _winapi.GetACP(). encodings._alias_mbcs() now calls _winapi.GetACP() to get the ANSI code page * locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8 mode. As a side effect, open() now uses the UTF-8 encoding by default in this mode. * Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding in the UTF-8 Mode. * Update subprocess._args_from_interpreter_flags() to handle -X utf8 * Skip some tests relying on the current locale if the UTF-8 mode is enabled. * Add test_utf8mode.py. * _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to return also the length (number of wide characters). * pymain_get_global_config() and pymain_set_global_config() now always copy flag values, rather than only copying if the new value is greater than the old value.
* bpo-32284: Fix documentation of BinaryIO and TextIO (#4832)Sebastian Rittau2017-12-131-3/+3
|
* Test atexit shutdown mechanism in a subprocess (#4828)Antoine Pitrou2017-12-132-0/+18
| | | | * Test atexit shutdown mechanism in a subprocess
* bpo-17852: Revert incorrect fix based on misunderstanding of _Py_PyAtExit() ↵Antoine Pitrou2017-12-135-78/+2
| | | | semantics (#4826)
* import.c: Fix a GCC warning (#4822)Victor Stinner2017-12-121-1/+1
| | | | | | Fix the warning: Python/import.c: warning: comparison between signed and unsigned integer expressions if ((i + n + 1) <= PY_SSIZE_T_MAX / sizeof(struct _inittab)) {
* bpo-32101: Fix tests for PYTHONDEVMODE=1 (#4821)Victor Stinner2017-12-123-17/+16
| | | | test_asycio: remove also aio_path which was used when asyncio was developed outside the stdlib.
* bpo-32230: Set sys.warnoptions with -X dev (#4820)Victor Stinner2017-12-1212-124/+224
| | | | | | | | | | | | | | Rather than supporting dev mode directly in the warnings module, this instead adjusts the initialisation code to add an extra 'default' entry to sys.warnoptions when dev mode is enabled. This ensures that dev mode behaves *exactly* as if `-Wdefault` had been passed on the command line, including in the way it interacts with `sys.warnoptions`, and with other command line flags like `-bb`. Fix also bpo-20361: have -b & -bb options take precedence over any other warnings options. Patch written by Nick Coghlan, with minor modifications of Victor Stinner.
* Fix improper use of re.escape() in tests. (#4814)Serhiy Storchaka2017-12-121-1/+1
|
* Fix implementation dependent assertion in test_plistlib. (#4813)Serhiy Storchaka2017-12-121-1/+2
| | | It is failed with an advanced optimizer.
* bpo-32241: Add the const qualifire to declarations of umodifiable strings. ↵Serhiy Storchaka2017-12-1215-56/+59
| | | | (#4748)
* bpo-31942: Document optional support of start and stop attributes in ↵Nitish Chandra2017-12-122-3/+6
| | | | Sequence.index method (#4277)
* bpo-32255: Always quote a single empty field when write into a CSV file. (#4769)Licht Takeuchi2017-12-124-2/+25
| | | This allows to distinguish an empty row from a row consisting of a single empty field.
* Fix small typo in tupleobject.h (#4801)Chris2017-12-121-1/+1
|
* Fix idlelib comment typos reported by Mike on pull request 4803. (#4807)Terry Jan Reedy2017-12-123-3/+3
|
* bpo-32227: functools.singledispatch supports registering via type ↵Łukasz Langa2017-12-114-8/+108
| | | | annotations (#4733)
* bpo-32258: Replace 'yield from' to 'await' in asyncio docs (#4779)Andrew Svetlov2017-12-119-82/+79
| | | | | | * Replace 'yield from' to 'await' in asyncio docs * Fix docstrings
* Add asyncio.get_running_loop() function. (#4782)Yury Selivanov2017-12-114-1/+27
|
* bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)Yury Selivanov2017-12-1117-61/+29
|
* bpo-32272: Remove asyncio.async() function. (#4784)Yury Selivanov2017-12-114-30/+2
|
* bpo-22671: Clarify and test default read method implementations (#4568)Sanyam Khurana2017-12-112-7/+59
| | | Original patch written by Martin Panter, enhanced by Sanyam Khurana.
* bpo-32252: Fix faulthandler_suppress_crash_report() (#4794)Victor Stinner2017-12-112-1/+3
| | | | Fix faulthandler_suppress_crash_report() used to prevent core dump files when testing crashes. getrlimit() returns zero on success.
* bpo-32262: Fix f-string (#4787)Yury Selivanov2017-12-111-1/+1
|
* bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)Yury Selivanov2017-12-1024-348/+332
|
* Skip test_read_pty_output test on macOS for poll and select. (#4774)Yury Selivanov2017-12-101-3/+1
| | | Starting with 10.13.2 the test hangs forever.
* bpo-32114: Updated the documentation for get_event_loop to reflect the ↵Pablo Galindo2017-12-101-4/+9
| | | | policy change (#4510)
* Removed doubled 'bpo-'. (#4777)Terry Jan Reedy2017-12-101-1/+1
|
* bpo-31506: Improve the error message logic for class instantiation (GH-4740)Sanyam Khurana2017-12-103-3/+54
| | | | | | | | | | | | The error messages in `object.__new__` and `object.__init__` now aim to point the user more directly at the name of the class being instantiated in cases where they *haven't* been overridden (on the assumption that the actual problem is a missing `__new__` or `__init__` definition in the class body). When they *have* been overridden, the errors still report themselves as coming from object, on the assumption that the problem is with the call up to the base class in the method implementation, rather than with the way the constructor is being called.
* byte swap the raw hash secrets (more bpo-32260) (#4773)Benjamin Peterson2017-12-091-1/+1
|
* fix my byte-swapping implementation (#4772)Benjamin Peterson2017-12-091-10/+10
|
* bpo-32260: don't byte swap siphash keys (#4771)Benjamin Peterson2017-12-092-3/+4
| | | | | Reference siphash takes the keys as a bytes, so it makes sense to byte swap when reifying the keys as 64-bit integers. However, Python's siphash takes host integers in to start with.
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-0933-2503/+3362
| | | | | | | | | | | | | | | | | | | | | | | | | Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
* bpo-32253: Deprecate with statement and bare await for asyncio locks (GH-4764)Andrew Svetlov2017-12-095-55/+108
| | | | | * Add test for 'with (yield from lock)' * Deprecate with statement for asyncio locks * Document the deprecation
* bpo-32212: Updated logging documentation to make parameter names more ↵Vinay Sajip2017-12-091-20/+21
| | | | consistent with source. (GH-4765)
* bpo-32193: Convert asyncio to async/await usage (#4753)Andrew Svetlov2017-12-0822-770/+646
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Convert asyncio/tasks.py to async/await * Convert asyncio/queues.py to async/await * Convert asyncio/test_utils.py to async/await * Convert asyncio/base_subprocess.py to async/await * Convert asyncio/subprocess.py to async/await * Convert asyncio/streams.py to async/await * Fix comments * Convert asyncio/locks.py to async/await * Convert asyncio.sleep to async def * Add a comment * Add missing news * Convert stubs from AbstrctEventLoop to async functions * Convert subprocess_shell/subprocess_exec * Convert connect_read_pipe/connect_write_pip to async/await syntax * Convert create_datagram_endpoint * Convert create_unix_server/create_unix_connection * Get rid of old style coroutines in unix_events.py * Convert selector_events.py to async/await * Convert wait_closed and create_connection * Drop redundant line * Convert base_events.py * Code cleanup * Drop redundant comments * Fix indentation * Add explicit tests for compatibility between old and new coroutines * Convert windows event loop to use async/await * Fix double awaiting of async function * Convert asyncio/locks.py * Improve docstring * Convert tests to async/await * Convert more tests * Convert more tests * Convert more tests * Convert tests * Improve test
* bpo-22589 Changed MIME type of .bmp to "image/bmp" (#4756)Nitish Chandra2017-12-082-1/+2
| | | Per rfc7903 this is the standard MIME type for this file format, and appears as such in the IANA MIME registry.
* Fix missing DECREF of mod. (#4749)Neil Schemenauer2017-12-081-0/+1
|
* PyLong_FromString(): fix Coverity CID 1424951 (#4738)Victor Stinner2017-12-071-3/+2
| | | | | | | | | | | Explicitly cast digits (Py_ssize_t) to double to fix the following false-alarm warning from Coverity: "fsize_z = digits * log_base_BASE[base] + 1;" CID 1424951: Incorrect expression (UNINTENDED_INTEGER_DIVISION) Dividing integer expressions "9223372036854775783UL" and "4UL", and then converting the integer quotient to type "double". Any remainder, or fractional part of the quotient, is ignored.