- 14 Jun, 2019 9 commits
-
-
Victor Stinner authored
In a subinterpreter, spawning a daemon thread now raises an exception. Daemon threads were never supported in subinterpreters. Previously, the subinterpreter finalization crashed with a Pyton fatal error if a daemon thread was still running. * Add _thread._is_main_interpreter() * threading.Thread.start() now raises RuntimeError if the thread is a daemon thread and the method is called from a subinterpreter. * The _thread module now uses Argument Clinic for the new function. * Use textwrap.dedent() in test_threading.SubinterpThreadingTests
-
Victor Stinner authored
Document reference cycle and resurrected objects issues in sys.unraisablehook() and threading.excepthook() documentation. Fix test.support.catch_unraisable_exception(): __exit__() no longer ignores unraisable exceptions. Fix test_io test_writer_close_error_on_close(): use a second catch_unraisable_exception() to catch the BufferedWriter unraisable exception.
-
Zackery Spytz authored
-
Steve Dower authored
-
Andrew Svetlov authored
-
Géry Ogam authored
This PR adds missing details in the [`concurrent.futures`](https://docs.python.org/3/library/concurrent.futures.html) documentation: * the mention that `Future.cancel` also returns `False` if the call finished running; * the mention of the states for `Future` that did not complete: pending or running.
-
Victor Stinner authored
Join the thread to prevent leaking a running thread and leaking a reference. Cleanup also the test: * asyncioWindowsProactorEventLoopPolicy became the default policy, there is no need to set it manually. * Only start the thread once the loop is running. * Use a shorter sleep in the thread (100 ms rather than 1 sec). * Use close_loop(loop) rather than loop.close(). * Use longer variable names.
-
Jeroen Demeyer authored
-
Pablo Galindo authored
Fix a regression introduced by af8646c8 that was causing code of the form: if True and False: do_something() to be optimized incorrectly, eliminating the block.
-
- 13 Jun, 2019 16 commits
-
-
Michael Felt authored
This is the followup for issue36084 https://bugs.python.org/issue37077
-
Victor Stinner authored
* Replace global var Py_VerboseFlag with interp->config.verbose. * Add _PyErr_NoMemory(tstate) function. * Add tstate parameter to _PyEval_SetCoroutineOriginTrackingDepth() and move the function to the internal API. * Replace _PySys_InitMain(runtime, interp) with _PySys_InitMain(runtime, tstate).
-
Pablo Galindo authored
The peephole optimizer was not optimizing correctly bytecode after negative deltas were introduced. This is due to the fact that some special values (255) were being searched for in both instruction pointer delta and line number deltas.
-
Makdon authored
It would raise ValueError("Paths don't have the same drive") if the paths on different drivers, which is not documented. os.path.commonpath raises ValueError when the *paths* are in different drivers, but it is not documented. Update the document according @Windsooon 's suggestion. It actually raise ValueError according line 355 of [test of path](https://github.com/python/cpython/blob/master/Lib/test/test_ntpath.py) https://bugs.python.org/issue6689
-
Victor Stinner authored
The __exit__() method of test.support.catch_unraisable_exception context manager now ignores unraisable exception raised when clearing self.unraisable attribute.
-
Victor Stinner authored
Allow pure Python implementation of pickle to work even when the C _pickle module is unavailable. Fix test_pickle when _pickle is missing: declare PyPicklerHookTests outside "if has_c_implementation:" block.
-
Victor Stinner authored
Remove the _tstate_lock from _shutdown_locks, don't remove None.
-
Jeroen Demeyer authored
-
Victor Stinner authored
PyAST_obj2mod_ex() is similar to PyAST_obj2mod() with an additional 'feature_version' parameter which is unused.
-
Jeffrey Kintscher authored
-
Makdon authored
-
Tim Peters authored
GH-14039: allow (no more than) one wholly empty arena on the usable_arenas list. This prevents thrashing in some easily-provoked simple cases that could end up creating and destroying an arena on each loop iteration in client code. Intuitively, if the only arena on the list becomes empty, it makes scant sense to give it back to the system unless we know we'll never need another free pool again before another arena frees a pool. If the latter obtains, then - yes - this will "waste" an arena.
-
Ned Deily authored
-
Victor Stinner authored
Remove ";" to fix Sphinx formatting.
-
Victor Stinner authored
Add a new _PyCompilerFlags_INIT macro to initialize PyCompilerFlags variables, rather than initializing cf_flags and cf_feature_version explicitly in each variable.
-
Victor Stinner authored
* Update PyCompilerFlags structure documentation. * Document the new cf_feature_version field in the Changes in the C API section of the What's New in Python 3.8 doc.
-
- 12 Jun, 2019 15 commits
-
-
Victor Stinner authored
Fix a race condition at Python shutdown when waiting for threads. Wait until the Python thread state of all non-daemon threads get deleted (join all non-daemon threads), rather than just wait until Python threads complete. * Add threading._shutdown_locks: set of Thread._tstate_lock locks of non-daemon threads used by _shutdown() to wait until all Python thread states get deleted. See Thread._set_tstate_lock(). * Add also threading._shutdown_locks_lock to protect access to threading._shutdown_locks. * Add test_finalization_shutdown() test.
-
Paul Monson authored
Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[]. This causes time.tzname to be an empty string. I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production. In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7 @zooba https://bugs.python.org/issue36779
-
Victor Stinner authored
regrtest now uses sys.unraisablehook() to mark a test as "environment altered" (ENV_CHANGED) if it emits an "unraisable exception". Moreover, regrtest logs a warning in this case. Use "python3 -m test --fail-env-changed" to catch unraisable exceptions in tests.
-
Victor Stinner authored
Use catch_unraisable_exception() to ignore 'Exception ignored in:' error when the internal BufferedWriter of the BufferedRWPair is destroyed. The C implementation doesn't give access to the internal BufferedWriter, so just ignore the warning instead.
-
Andrew Svetlov authored
-
Paul Monson authored
-
Paul Monson authored
-
David Carlier authored
-
Michael Felt authored
because "getaddrinfo()" behaves different on AIX https://bugs.python.org/issue35545
-
Ammar Askar authored
* bpo-29505: Enable fuzz testing of the json module, enforce size limit on int(x) fuzz and json input size to avoid timeouts. Contributed by by Ammar Askar for Google.
-
Yao Zuo authored
Python 3.6 changed the size of bytecode instruction, while the documentation for `EXTENDED_ARG` was not updated accordingly.
-
Victor Stinner authored
Fix MSVC warning: objects\codeobject.c(285): warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data
-
Victor Stinner authored
Mock the HTTPConnection.close() method in a few unit tests to avoid logging "Exception ignored in: ..." messages.
-
Victor Stinner authored
Rename compile() feature_version parameter to _feature_version and convert it to a keyword-only parameter. Update also test_type_comments to pass feature_version as a tuple.
-
Guido van Rossum authored
(A single int is still allowed, but undocumented.) https://bugs.python.org/issue35766
-