summaryrefslogtreecommitdiff
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-26467: Adds AsyncMock for asyncio Mock library support (GH-9296)Lisa Roach2019-05-203-19/+941
|
* Pass _asyncio_internal=True into stream tests on windows (#13442)Andrew Svetlov2019-05-201-2/+4
|
* bpo-36763: Fix encoding/locale tests in test_embed (GH-13443)Victor Stinner2019-05-201-87/+103
| | | | | * Fix encoding and locale tests in test_embed.InitConfigTests. * InitConfigTests now only computes EXPECTED_CONFIG once. * Add tests for PYTHONWARNINGS and PYTHONPATH env vars
* bpo-35721: Close socket pair if Popen in _UnixSubprocessTransport fails ↵Niklas Fiekas2019-05-202-10/+25
| | | | | | | | (GH-11553) This slightly expands an existing test case `test_popen_error` to trigger a `ResourceWarning` and fixes it. https://bugs.python.org/issue35721
* bpo-36763: Fix Python preinitialization (GH-13432)Victor Stinner2019-05-201-22/+74
| | | | | | | | | | | | | | | | | | | | | * Add _PyPreConfig.parse_argv * Add _PyCoreConfig._config_init field and _PyCoreConfigInitEnum enum type * Initialization functions: reject preconfig=NULL and config=NULL * Add config parameter to _PyCoreConfig_DecodeLocaleErr(): pass config->argv to _Py_PreInitializeFromPyArgv(), to parse config command line arguments in preinitialization. * Add config parameter to _PyCoreConfig_SetString(). It now preinitializes Python. * _PyCoreConfig_SetPyArgv() now also preinitializes Python for wide argv * Fix _Py_PreInitializeFromCoreConfig(): don't pass args to _Py_PreInitializeFromPyArgv() if config.parse_argv=0. * Use "char * const *" and "wchar_t * const *" types for 'argv' parameters and _PyArgv.argv. * Add unit test on preinitialization from argv. * _PyPreConfig.allocator type becomes int * Add _PyPreConfig_InitFromPreConfig() and _PyPreConfig_InitFromCoreConfig() helper functions
* bpo-36958: In IDLE, print exit message (GH-13435)Terry Jan Reedy2019-05-193-6/+15
| | | | | Print any argument other than None or int passed to SystemExit or sys.exit().
* bpo-35252: Remove FIXME from test_functools (GH-10551)Lysandros Nikolaou2019-05-192-9/+10
|
* bpo-36957: Speed up math.isqrt (#13405)Mark Dickinson2019-05-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add math.isqrt function computing the integer square root. * Code cleanup: remove redundant comments, rename some variables. * Tighten up code a bit more; use Py_XDECREF to simplify error handling. * Update Modules/mathmodule.c Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Update Modules/mathmodule.c Use real argument clinic type instead of an alias Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Add proof sketch * Updates from review. * Correct and expand documentation. * Fix bad reference handling on error; make some variables block-local; other tidying. * Style and consistency fixes. * Add missing error check; don't try to DECREF a NULL a * Simplify some error returns. * Another two test cases: - clarify that floats are rejected even if they happen to be squares of small integers - TypeError beats ValueError for a negative float * Add fast path for small inputs. Needs tests. * Speed up isqrt for n >= 2**64 as well; add extra tests. * Reduce number of test-cases to avoid dominating the run-time of test_math. * Don't perform unnecessary extra iterations when computing c_bit_length. * Abstract common uint64_t code out into a separate function. * Cleanup. * Add a missing Py_DECREF in an error branch. More cleanup. * Update Modules/mathmodule.c Add missing `static` declaration to helper function. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Add missing backtick.
* bpo-29183: Fix double exceptions in wsgiref.handlers.BaseHandler (GH-12914)Berker Peksag2019-05-192-1/+35
|
* bpo-27141: Fix collections.UserList and UserDict shallow copy. (GH-4094)Bar Harel2019-05-192-0/+38
|
* bpo-36948: Fix NameError in urllib.request.URLopener.retrieve (GH-13389)Xtreak2019-05-192-6/+24
|
* Fix typo in test comment (GH-11442)Ashwin Ramaswami2019-05-181-1/+1
|
* bpo-36961: Handle positional-only arguments in uparse.c (GH-13412)Pablo Galindo2019-05-181-0/+12
|
* Add support for PEP572 in ast_unparse.c (GH-13337)Batuhan Taşkaya2019-05-181-0/+2
|
* bpo-2180: Treat line continuation at EOF as a `SyntaxError` (GH-13401)Anthony Sottile2019-05-181-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the parser consistent with the tokenize module (already the case in `pypy`). sample ------ ```python x = 5\ ``` before ------ ```console $ python3 t.py $ python3 -mtokenize t.py t.py:2:0: error: EOF in multi-line statement ``` after ----- ```console $ ./python t.py File "t.py", line 3 x = 5\ ^ SyntaxError: unexpected EOF while parsing $ ./python -m tokenize t.py t.py:2:0: error: EOF in multi-line statement ``` https://bugs.python.org/issue2180
* bpo-36546: Add more tests and expand docs (#13406)Raymond Hettinger2019-05-181-11/+27
|
* bpo-36887: add math.isqrt (GH-13244)Mark Dickinson2019-05-181-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add math.isqrt function computing the integer square root. * Code cleanup: remove redundant comments, rename some variables. * Tighten up code a bit more; use Py_XDECREF to simplify error handling. * Update Modules/mathmodule.c Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Update Modules/mathmodule.c Use real argument clinic type instead of an alias Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> * Add proof sketch * Updates from review. * Correct and expand documentation. * Fix bad reference handling on error; make some variables block-local; other tidying. * Style and consistency fixes. * Add missing error check; don't try to DECREF a NULL a * Simplify some error returns. * Another two test cases: - clarify that floats are rejected even if they happen to be squares of small integers - TypeError beats ValueError for a negative float * Documentation and markup improvements; thanks Serhiy for the suggestions! * Cleaner Misc/NEWS entry wording. * Clean up (with one fix) to the algorithm explanation and proof.
* bpo-36763: Remove _PyCoreConfig.dll_path (GH-13402)Victor Stinner2019-05-181-3/+0
|
* bpo-36763: Use _PyCoreConfig_InitPythonConfig() (GH-13398)Victor Stinner2019-05-181-40/+65
| | | | | | | | | | | | | | | | | _PyPreConfig_InitPythonConfig() and _PyCoreConfig_InitPythonConfig() no longer inherit their values from global configuration variables. Changes: * _PyPreCmdline_Read() now ignores -X dev and PYTHONDEVMODE if dev_mode is already set. * Inline _PyPreConfig_INIT macro into _PyPreConfig_Init() function. * Inline _PyCoreConfig_INIT macro into _PyCoreConfig_Init() function. * Replace _PyCoreConfig_Init() with _PyCoreConfig_InitPythonConfig() in most tests of _testembed.c. * Replace _PyCoreConfig_Init() with _PyCoreConfig_InitIsolatedConfig() in _freeze_importlib.c. * Move some initialization functions from the internal to the private API.
* bpo-36945: Add _PyPreConfig.configure_locale (GH-13368)Victor Stinner2019-05-171-4/+30
| | | | | _PyPreConfig_InitIsolatedConfig() sets configure_locale to 0 to prevent Python to modify the LC_CTYPE locale. In that case, coerce_c_locale an coerce_c_locale_warn are set to 0 as well.
* bpo-36782: Created C API wrappers and added missing tests for functions in ↵Edison A2019-05-171-3/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the PyDateTimeAPI. (#13088) * created a c API wrapper for pyDate_FromDate and added the test * 📜🤖 Added by blurb_it. * fixed auto-alignment by vscode * made changes as per PEP7 * Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst * Refactored code as per requested changes * Remove Whitespace to Fix failed travis build * Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst * Add a new line at end of ACKS * Added C API function for PyDateTime_FromDateAndTime * Added a test for the C API wrapper of PyDateTime_FromDateAndTime * Added C API function for PyDateTime_FromDateAndTime * Added a test for the C API wrapper of PyDateTime_FromDateAndTimeAndFold * Remove Whitespace using patchcheck * Added a C API function for PyTime_FromTime * Added a test for the C API wrapper of PyTime_FromTime * Added a C API function for PyTime_FromTimeAndFold * Added a test for the C API wrapper of PyTime_FromTimeAndFold * Added a C API function for PyDelta_FromDSU * Added a test for the C API wrapper of PyDelta_FromDSU * Refactor code, re-edit lines longer than 80 chars * Fix Whitespace issues in DatetimeTester * List all tests that were added in this PR * Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst * Reformat code as per PEP7 guidelines * Remove unused varibles from another function * Added specific tests for the Fold Attribute * Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst * Reformat code according to requested changes * Reformat code to PEP7 Guidelines * Reformat code to PEP7 Guidelines * Re-add name to blurb * Added a backtick to blurb file * Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst * Remove the need to initialize mandatory parameters * Make the macro parameter mandatory * Re-arrange the order of unit-test args * Removed the need to initialize macro change all the int macro = 0 to int macro; now that macro is required Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com> * Removed the need to initialize macro change all the `int macro = 0` to `int macro`; now that macro is required Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com> * Removed the need to initialize macro change all the `int macro = 0` to `int macro`; now that macro is required Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com> * Removed the need to initialize macro change all the `int macro = 0` to `int macro`; now that macro is required Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com> * Removed the need to initialize macro change all the `int macro = 0` to `int macro`; now that macro is required Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com> * Removed the need to initialize macro change all the `int macro = 0` to `int macro`; now that macro is required Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com>
* bpo-33524: Fix the folding of email header when max_line_length is 0 or None ↵Abhilash Raj2019-05-173-2/+17
| | | | | (#13391) and there are non-ascii characters in the header.
* bpo-36867: _test_multiprocessing: avoid weak sync primitive (GH-13292)Pierre Glaser2019-05-171-4/+12
| | | Avoid weak sync primitive in multiprocessing resource_tracker test.
* bpo-36763: Add _PyCoreConfig_InitPythonConfig() (GH-13388)Victor Stinner2019-05-171-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new functions to get the Python interpreter behavior: * _PyPreConfig_InitPythonConfig() * _PyCoreConfig_InitPythonConfig() Add new functions to get an isolated configuration: * _PyPreConfig_InitIsolatedConfig() * _PyCoreConfig_InitIsolatedConfig() Replace _PyPreConfig_INIT and _PyCoreConfig_INIT with new functions _PyPreConfig_Init() and _PyCoreConfig_Init(). _PyCoreConfig: set configure_c_stdio and parse_argv to 0 by default to behave as Python 3.6 in the default configuration. _PyCoreConfig_Read() no longer sets coerce_c_locale_warn to 1 if it's equal to 0. coerce_c_locale_warn must now be set to -1 (ex: using _PyCoreConfig_InitPythonConfig()) to enable C locale coercion warning. Add unit tests for _PyCoreConfig_InitPythonConfig() and _PyCoreConfig_InitIsolatedConfig(). Changes: * Rename _PyCoreConfig_GetCoreConfig() to _PyPreConfig_GetCoreConfig() * Fix core_read_precmdline(): handle parse_argv=0 * Fix _Py_PreInitializeFromCoreConfig(): pass coreconfig.argv to _Py_PreInitializeFromPyArgv(), except if parse_argv=0
* bpo-36763: Add PyMemAllocatorName (GH-13387)Victor Stinner2019-05-171-6/+9
| | | | | | | | | | | | | | * Add PyMemAllocatorName enum * _PyPreConfig.allocator type becomes PyMemAllocatorName, instead of char* * Remove _PyPreConfig_Clear() * Add _PyMem_GetAllocatorName() * Rename _PyMem_GetAllocatorsName() to _PyMem_GetCurrentAllocatorName() * Remove _PyPreConfig_SetAllocator(): just call _PyMem_SetupAllocators() directly, we don't have do reallocate the configuration with the new allocator anymore! * _PyPreConfig_Write() parameter becomes const, as it should be in the first place!
* Simplify SSLSocket / SSLObject doc string (GH-9972)Christian Heimes2019-05-171-16/+21
| | | | | | Instead of maintaining the same doc string two times, let's copy common doc strings from SSLObject methods and properties to SSLSocket. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away ↵Pablo Galindo2019-05-171-0/+14
| | | | | | | (GH-13332) Move the check for dead conditionals (if 0) to the peephole optimizer and make sure that the code block is still compiled to report any existing syntax errors within.
* bpo-36763: Remove _PyCoreConfig.program (GH-13373)Victor Stinner2019-05-171-5/+0
| | | Use _PyCoreConfig.program_name instead.
* bpo-35545: Fix asyncio discarding IPv6 scopes (GH-11271)Erwan Le Pape2019-05-172-3/+25
| | | | | | | | This PR proposes a solution to [bpo-35545](https://bugs.python.org/issue35545) by adding an optional `flowinfo` and `scopeid` to `asyncio.base_events._ipaddr_info` to carry the full address information into `_ipaddr_info` and avoid discarding IPv6 specific information. Changelog entry & regression tests to come. https://bugs.python.org/issue35545
* bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)Zackery Spytz2019-05-176-7/+20
| | | | | | | The final addition (cur += step) may overflow, so use size_t for "cur". "cur" is always positive (even for negative steps), so it is safe to use size_t here. Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
* bpo-36751: Undeprecate getfullargspec (GH-13245)Pablo Galindo2019-05-162-40/+20
|
* bpo-36763: Add _PyCoreConfig.configure_c_stdio (GH-13363)Victor Stinner2019-05-161-0/+4
| | | Add tests for configure_c_stdio and pathconfig_warnings parameters.
* bpo-36763: Add _Py_InitializeMain() (GH-13362)Victor Stinner2019-05-161-12/+31
| | | | | | | | | * Add a private _Py_InitializeMain() function. * Add again _PyCoreConfig._init_main. * _Py_InitializeFromConfig() now uses _init_main to decide if _Py_InitializeMainInterpreter() should be called. * _PyCoreConfig: rename _frozen to pathconfig_warnings, its value is now the opposite of Py_FrozenFlag. * Add an unit test for _init_main=0 and _Py_InitializeMain().
* bpo-36763: Add _PyCoreConfig.parse_argv (GH-13361)Victor Stinner2019-05-161-0/+9
| | | | | | | * _PyCoreConfig_Read() doesn't parse nor update argv if parse_argv is 0. * Move path configuration fields in _PyCoreConfig. * Add an unit test for parse_argv=0. * Remove unused "done": label in _Py_RunMain().
* bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)Andrew Svetlov2019-05-1610-317/+306
| | | | | | The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is. https://bugs.python.org/issue36921
* bpo-35589: Prevent buffer copy in sock_sendall() (GH-11418)Andrew Svetlov2019-05-161-7/+10
| | | | | | No NEWs is needed since the problem was introduced on master only and never released. https://bugs.python.org/issue35589
* Fix typos in documentation. Patch by tirkarthi. (GH-13354)Terry Jan Reedy2019-05-161-6/+6
|
* bpo-35926: Add support for OpenSSL 1.1.1b on Windows (GH-11779)Paul Monson2019-05-152-4/+19
|
* bpo-33123: pathlib: Add missing_ok parameter to Path.unlink (GH-6191)‮zlohhcuB treboR2019-05-152-2/+11
| | | | | | Similarly to how several pathlib file creation functions have an "exists_ok" parameter, we should introduce "missing_ok" that makes removal functions not raise an exception when a file or directory is already absent. IMHO, this should cover Path.unlink and Path.rmdir. Note, Path.resolve() has a "strict" parameter since 3.6 that does the same thing. Naming this of this new parameter tries to be consistent with the "exists_ok" parameter as that is more explicit about what it does (as opposed to "strict"). https://bugs.python.org/issue33123
* bpo-36786: Run compileall in parallel during "make install" (GH-13078)Antoine Pitrou2019-05-152-15/+12
|
* bpo-26707: Enable plistlib to read UID keys. (GH-12153)Jon Janzen2019-05-152-5/+142
| | | | | | | | | Plistlib currently throws an exception when asked to decode a valid .plist file that was generated by Apple's NSKeyedArchiver. Specifically, this is caused by a byte 0x80 (signifying a UID) not being understood. This fixes the problem by enabling the binary plist reader and writer to read and write plistlib.UID objects.
* bpo-36763: InitConfigTests tests all core config (GH-13331)Victor Stinner2019-05-151-19/+26
| | | | | | | | | Remove UNTESTED_CORE_CONFIG from test_embed.InitConfigTests: all core config fields are now tested! Changes: * Test also dll_path on Windows * Add run_main_config unit test: test config using _Py_RunMain().
* bpo-36801: Temporarily fix regression in writer.drain() (#13330)Andrew Svetlov2019-05-152-26/+1
|
* bpo-36763: Add test for _PyCoreConfig_SetString() (GH-13275)Victor Stinner2019-05-141-7/+35
| | | | test_embed: add test_init_read_set() to test newly added APIs: test module_search_paths and executable.
* bpo-33529, email: Fix infinite loop in email header encoding (GH-12020)Krzysztof Wojcik2019-05-143-14/+25
|
* json.tool: use stdin and stdout in default cmdlne arguments (GH-11992)Hervé Beraud2019-05-141-4/+6
| | | | Argparse can handle default value as stdin and stdout for parameters as file type (infile, outfile).
* bpo-36916: asyncio: Swallow unhandled write() exception (GH-13313)Andrew Svetlov2019-05-142-1/+13
|
* bpo-36915: regrtest always remove tempdir of worker processes (GH-13312)Victor Stinner2019-05-142-44/+66
| | | | | | | | | When using multiprocessing (-jN option), worker processes now create their temporary directory inside the temporary directory of the main process. So the main process is able to remove temporary directories of worker processes even if they crash or when they are killed by regrtest on KeyboardInterrupt (CTRL+c). Rework also how multiprocessing arguments are parsed in main.py.
* bpo-36845: validate integer network prefix when constructing IP networks ↵Nicolai Moore2019-05-142-0/+20
| | | | (GH-13298)
* bpo-36719: Fix regrtest MultiprocessThread (GH-13301)Victor Stinner2019-05-141-4/+55
| | | | MultiprocessThread.kill() now closes stdout and stderr to prevent popen.communicate() to hang.