summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37008: make mock_open handle able to honor next() (GH-13492)Damien Nadé2019-05-234-0/+36
| | | | | | | | I've reported the issue on https://bugs.python.org/issue37008 and now I'm trying to bring a solution to this minor issue. I think it could be trivially backported to 3.7 branch. https://bugs.python.org/issue37008
* bpo-33164: update blake2 implementation (GH-6286)David Carlier2019-05-2327-685/+18379
|
* bpo-36763: Fix _PyPreConfig_InitCompatConfig() utf8_mode (GH-13518)Victor Stinner2019-05-234-11/+77
| | | | | | | | | | * _PyPreConfig_InitCompatConfig() sets utf8_mode to 0. * Change Py_UTF8Mode default value to 0. * Fix _PyPreConfig_Copy(): copy also _config_init attrbibute. * _PyPreConfig_AsDict() exports _config_init * Fix _PyPreConfig_GetGlobalConfig(): use Py_UTF8Mode if it's greater than 0, even if utf8_mode >= 0. * Add unit tests on environment variables using Python API.
* bpo-18748: _pyio.IOBase emits unraisable exception (GH-13512)Victor Stinner2019-05-233-45/+51
| | | | | | | | In development (-X dev) mode and in a debug build, IOBase finalizer of the _pyio module now logs the exception if the close() method fails. The exception is ignored silently by default in release build. test_io: test_error_through_destructor() now uses support.catch_unraisable_exception() rather than capturing stderr.
* bpo-36721: Add --embed option to python-config (GH-13500)Victor Stinner2019-05-2310-9/+78
| | | | | | | | | | | | | | | | | | | | | To embed Python into an application, a new --embed option must be passed to "python3-config --libs --embed" to get "-lpython3.8" (link the application to libpython). To support both 3.8 and older, try "python3-config --libs --embed" first and fallback to "python3-config --libs" (without --embed) if the previous command fails. Add a pkg-config "python-3.8-embed" module to embed Python into an application: "pkg-config python-3.8-embed --libs" includes "-lpython3.8". To support both 3.8 and older, try "pkg-config python-X.Y-embed --libs" first and fallback to "pkg-config python-X.Y --libs" (without --embed) if the previous command fails (replace "X.Y" with the Python version). On the other hand, "pkg-config python3.8 --libs" no longer contains "-lpython3.8". C extensions must not be linked to libpython (except on Android, case handled by the script); this change is backward incompatible on purpose. "make install" now also installs "python-3.8-embed.pc".
* bpo-27737: Allow whitespace only headers encoding (#13478)Batuhan Taşkaya2019-05-233-1/+6
|
* bpo-35091: Objects/listobject.c: Replace overflow checks in gallop fu… ↵Alexey Izbyshev2019-05-231-8/+4
| | | | | | | | | | | | | | | | (GH-10202) …nctions with asserts The actual overflow can never happen because of the following: * The size of a list can't be greater than PY_SSIZE_T_MAX / sizeof(PyObject*). * The size of a pointer on all supported plaftorms is at least 4 bytes. * ofs is positive and less than the list size at the beginning of each iteration. https://bugs.python.org/issue35091
* bpo-36829: PyErr_WriteUnraisable() normalizes exception (GH-13507)Victor Stinner2019-05-225-13/+47
| | | | | | PyErr_WriteUnraisable() now creates a traceback object if there is no current traceback. Moreover, call PyErr_NormalizeException() and PyException_SetTraceback() to normalize the exception value. Ignore silently any error.
* bpo-36763: Rename private Python initialization functions (GH-13511)Victor Stinner2019-05-223-122/+117
| | | | | | | | | | | * Rename private C functions: * _Py_Initialize_ReconfigureCore => pyinit_core_reconfigure * _Py_InitializeCore_impl => pyinit_core_config * _Py_InitializeCore = > pyinit_core * _Py_InitializeMainInterpreter => pyinit_main * init_python => pyinit_python * Rename _testembed.c commands: add "test_" prefix.
* bpo-36941: Project file fixups for Windows ARM64 (GH-13477)Paul Monson2019-05-222-5/+18
|
* bpo-36763: Add _PyPreConfig._config_init (GH-13481)Victor Stinner2019-05-2211-108/+200
| | | | | | | | | | | | | | | | | | | * _PyPreConfig_GetGlobalConfig() and _PyCoreConfig_GetGlobalConfig() now do nothing if the configuration was not initialized with _PyPreConfig_InitCompatConfig() and _PyCoreConfig_InitCompatConfig() * Remove utf8_mode=-2 special case: use utf8_mode=-1 instead. * Fix _PyPreConfig_InitPythonConfig(): * isolated = 0 instead of -1 * use_environment = 1 instead of -1 * Rename _PyConfig_INIT to _PyConfig_INIT_COMPAT * Rename _PyPreConfig_Init() to _PyPreConfig_InitCompatConfig() * Rename _PyCoreConfig_Init() to _PyCoreConfig_InitCompatConfig() * PyInterpreterState_New() now uses _PyCoreConfig_InitPythonConfig() as default configuration, but it's very quickly overriden anyway. * _freeze_importlib.c uses _PyCoreConfig_SetString() to set program_name. * Cleanup preconfig_init_utf8_mode(): cmdline is always non-NULL.
* bpo-36829: Add test.support.catch_unraisable_exception() (GH-13490)Victor Stinner2019-05-226-43/+108
| | | | | | * Copy test_exceptions.test_unraisable() to test_sys.UnraisableHookTest(). * Use catch_unraisable_exception() in test_coroutines, test_exceptions, test_generators.
* bpo-24882: Let ThreadPoolExecutor reuse idle threads before creating new ↵Sean2019-05-223-5/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thread (#6375) * Fixes issue 24882 * Add news file entry for change. * Change test_concurrent_futures.ThreadPoolShutdownTest Adjust the shutdown test so that, after submitting three jobs to the executor, the test checks for less than three threads, instead of looking for exactly three threads. If idle threads are being recycled properly, then we should have less than three threads. * Switched idle count to semaphor, Updated tests As suggested by reviewer tomMoral, swapped lock-protected counter with a semaphore to track the number of unused threads. Adjusted test_threads_terminate to wait for completiton of the previous future before submitting a new one (and checking the number of threads used). Also added a new test to confirm the thread pool can be saturated. * Updates tests as requested by pitrou. * Correct minor whitespace error. * Make test_saturation faster
* bpo-33110: Catch errors raised when running add_done_callback on already ↵Sam Martin2019-05-223-1/+21
| | | | | | completed futures (GH-13141) Wrap the callback call within the `add_done_callback` function within concurrent.futures, in order to behave in an identical manner to callbacks added to a running future are triggered once it has completed.
* bpo-36878: Only allow text after `# type: ignore` if first character ASCII ↵Michael J. Sullivan2019-05-223-2/+6
| | | | | | | | | | | (GH-13504) This disallows things like `# type: ignoreé`, which seems wrong. Also switch to using Py_ISALNUM for the alnum check, for consistency with other code (and maybe correctness re: locale issues?). https://bugs.python.org/issue36878
* bpo-35907, CVE-2019-9948: urllib rejects local_file:// scheme (GH-13474)Victor Stinner2019-05-223-1/+16
| | | | | | | CVE-2019-9948: Avoid file reading as disallowing the unnecessary URL scheme in URLopener().open() and URLopener().retrieve() of urllib.request. Co-Authored-By: SH <push0ebp@gmail.com>
* bpo-34616: Document top level async in whatsnew/3.8. (GH-13484)Matthias Bussonnier2019-05-221-0/+10
| | | https://bugs.python.org/issue34616
* bpo-36084: Add native thread ID (TID) to threading.Thread (GH-13463)Jake Tesler2019-05-229-0/+154
| | | | Add native thread ID (TID) to threading.Thread objects (supported platforms: Windows, FreeBSD, Linux, macOS).
* bpo-33482: fix codecs.StreamRecoder.writelines (GH-6779)Jelle Zijlstra2019-05-223-1/+23
| | | | | | A very simple fix. I found this while writing typeshed stubs for StreamRecoder. https://bugs.python.org/issue33482
* bpo-36878: Track extra text added to 'type: ignore' in the AST (GH-13479)Michael J. Sullivan2019-05-229-26/+86
| | | | | GH-13238 made extra text after a # type: ignore accepted by the parser. This finishes the job and actually plumbs the extra text through the parser and makes it available in the AST.
* bpo-36972: Add SupportsIndex (GH-13448)Paul Dagnelie2019-05-225-0/+21
| | | | In order to support typing checks calling hex(), oct() and bin() on user-defined classes, a SupportIndex protocol is required. The ability to check these at runtime would be good to add for completeness sake. This is pretty much just a copy of SupportsInt with the names tweaked.
* bpo-31862: Port binascii to PEP 489 multiphase initialization (GH-4108)Marcel Plch2019-05-223-34/+118
|
* bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381)Jeroen Demeyer2019-05-223-5/+31
|
* bpo-36994: add test for profiling method_descriptor with **kwargs (GH-13461)Jeroen Demeyer2019-05-221-0/+9
| | | | | It adds a missing testcase for bpo-34125. This is testing code which is affected by PEP 590, so missing this test might accidentally break CPython if we screw up with implementing PEP 590.
* bpo-36829: Add sys.unraisablehook() (GH-13187)Victor Stinner2019-05-2212-117/+491
| | | | | | | | | | | | | | | | | | | Add new sys.unraisablehook() function which can be overridden to control how "unraisable exceptions" are handled. It is called when an exception has occurred but there is no way for Python to handle it. For example, when a destructor raises an exception or during garbage collection (gc.collect()). Changes: * Add an internal UnraisableHookArgs type used to pass arguments to sys.unraisablehook. * Add _PyErr_WriteUnraisableDefaultHook(). * The default hook now ignores exception on writing the traceback. * test_sys now uses unittest.main() to automatically discover tests: remove test_main(). * Add _PyErr_Init(). * Fix PyErr_WriteUnraisable(): hold a strong reference to sys.stderr while using it
* bpo-36948: Fix test_urlopener_retrieve_file on Windows (GH-13476)Berker Peksag2019-05-211-1/+2
|
* bpo-34616: Fix code style and unbreak buildbots (GH-13473)Yury Selivanov2019-05-211-18/+20
| | | See also PR GH-13148.
* bpo-25652: Fix __rmod__ of UserString (GH-13326)Batuhan Taşkaya2019-05-213-3/+15
| | | | | | The ``__rmod__`` method of ``collections.UserString`` class had a bug that made it unusable. https://bugs.python.org/issue25652
* bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)Matthias Bussonnier2019-05-217-8/+109
| | | Co-Authored-By: Yury Selivanov <yury@magic.io>
* bpo-23378: Add an extend action to argparse (GH-13305)Batuhan Taşkaya2019-05-214-0/+26
| | | | | | Add an extend action to argparse https://bugs.python.org/issue23378
* bpo-36035: fix Path.rglob for broken links (GH-11988)Jörg Stucke2019-05-213-5/+17
| | | Links creating an infinite symlink loop would raise an exception.
* bpo-36929: Modify io/re tests to allow for missing mod name (#13392)Max Bernstein2019-05-213-29/+34
| | | | | | | | | | | | | | | | | | * bpo-36929: Modify io/re tests to allow for missing mod name For a vanishingly small number of internal types, CPython sets the tp_name slot to mod_name.type_name, either in the PyTypeObject or the PyType_Spec. There are a few minor places where this surfaces: * Custom repr functions for those types (some of which ignore the tp_name in favor of using a string literal, such as _io.TextIOWrapper) * Pickling error messages The test suite only tests the former. This commit modifies the test suite to allow Python implementations to omit the module prefix. https://bugs.python.org/issue36929
* Annotate the unexplained assignment in exception unbinding (GH-11448)Chris Angelico2019-05-211-1/+1
|
* bpo-36648: fix mmap issue for VxWorks (GH-12394)Lihua Zhao2019-05-212-0/+8
| | | | | The mmap module set MAP_SHARED flag when map anonymous memory, however VxWorks only support MAP_PRIVATE when map anonymous memory, this commit clear MAP_SHARED and set MAP_PRIVATE.
* bpo-31904: Add posix module support for VxWorks (GH-12118)pxinwr2019-05-218-15/+84
|
* Revert "bpo-36084: Add native thread ID to threading.Thread objects ↵Victor Stinner2019-05-2110-133/+2
| | | | | (GH-11993)" (GH-13458) This reverts commit 4959c33d2555b89b494c678d99be81a65ee864b0.
* bpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421)Erik Janssens2019-05-212-2/+3
| | | | Include windows.h rather than crtdbg.h to get STATUS_CONTROL_C_EXIT constant. Moreover, include windows.h on Windows, not only when MSC is used.
* Fix RuntimeWarning in unittest.mock asyncio example (GH-13449)Xtreak2019-05-212-3/+3
| | | | * This PR fixes the `RuntimeWarning` in `inspect.isawaitable(mock())` where `mock()` was not awaited. * Fix typo in asynctest project.
* bpo-36932: use proper deprecation-removed directive (GH-13349)Matthias Bussonnier2019-05-213-24/+31
| | | | | | | | .. And update some deprecation warnings with version numbers. https://bugs.python.org/issue36932
* Remove workaround for defaults in namedtuple now that we have the defaults ↵Andre Delfino2019-05-211-9/+0
| | | | | | parameter (GH-13263)
* bpo-35563: Add reference links to warnings.rst (GH-11289)Cheryl Sabella2019-05-201-12/+12
|
* bpo-36969: Make PDB args command display keyword only arguments (GH-13452)Rémi Lapeyre2019-05-203-7/+26
|
* bpo-36952: Remove the bufsize parameter in fileinput.input(). (GH-13400)Matthias Bussonnier2019-05-205-47/+41
| | | | | This parameter is marked as deprecated since 3.6 and for removal in 3.8. It already had no effects.
* bpo-23896: Add a grammar where exec isn't a stmt (#13272)Batuhan Taşkaya2019-05-203-0/+6
| | | https://bugs.python.org/issue23896
* bpo-36888: Add multiprocessing.parent_process() (GH-13247)Thomas Moreau2019-05-2012-20/+155
|
* bpo-36949: Implement __repr__ on WeakSet (GH-13415)Batuhan Taşkaya2019-05-203-0/+7
|
* bpo-26467: Adds AsyncMock for asyncio Mock library support (GH-9296)Lisa Roach2019-05-206-20/+1161
|
* bpo-36763: Fix _PyRuntime.preconfig.coerce_c_locale (GH-13444)Victor Stinner2019-05-203-19/+37
| | | | | | | | | | | _PyRuntime.preconfig.coerce_c_locale can now be used to check if the C locale has been coerced. * Fix _Py_LegacyLocaleDetected(): don't attempt to coerce the C locale if LC_ALL environment variable is set. Add 'warn' parameter: emit_stderr_warning_for_legacy_locale() must not the LC_ALL env var. * _PyPreConfig_Write() sets coerce_c_locale to 0 if _Py_CoerceLegacyLocale() fails.
* bpo-22865: Expand on documentation for the pty.spawn function (GH-11980)Geoff Shannon2019-05-203-4/+27
|
* Pass _asyncio_internal=True into stream tests on windows (#13442)Andrew Svetlov2019-05-201-2/+4
|