Print any argument other than None or int passed to SystemExit
or sys.exit().
(cherry picked from commit 6d965b39b7)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
The sqlite3.Connection object doesn't call its close() method when it's used
as a context manager.
(cherry picked from commit 287b84de93)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
Given example does not run, loop variable is missing.
Secondly, this is bad example how to handle shutdown signal, because it would cause `RuntimeError: Event loop stopped before Future completed.`
Perhaps it would be better to cancel all tasks instead of closing loop directly?
Did not create issue, because question is quite simple.
(cherry picked from commit ceb842e155)
Co-authored-by: Alexander Vasin <hi@alvass.in>
Makes the documentation of math and cmath module
more helpful for the beginners.
(cherry picked from commit 6faad355db)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
and there are non-ascii characters in the header.
(cherry picked from commit feac6cd775)
Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
Instead of maintaining the same docstring two times, let's copy common
docstrings from SSLObject methods and properties to SSLSocket.
(cherry picked from commit 80ed353329)
Co-authored-by: Christian Heimes <christian@python.org>
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.
(cherry picked from commit af8646c805)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
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
(cherry picked from commit ac8eb8f36b)
Co-authored-by: Erwan Le Pape <lepaperwan@users.noreply.github.com>
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>
(cherry picked from commit 14514d9084)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Clarify how to capture stdout and stderr combined into one stream.
(cherry picked from commit e883091abf)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
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.
(cherry picked from commit 3c93153f7d)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
MultiprocessThread.kill() now closes stdout and stderr to prevent
popen.communicate() to hang.
(cherry picked from commit c923c3449f)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
Extended attributes can only be set on user-writeable files, but shutil previously
first chmod()ed the destination file to the source's permissions and then tried to
copy xattrs. This will cause failures if attempting to copy read-only files with
xattrs, as occurs with Git clones on Lustre FS.
(cherry picked from commit 79efbb7193)
Co-authored-by: Olexa Bilaniuk <obilaniu@users.noreply.github.com>
* Docs: Add bz2 usage examples
- Adds an "Examples of usage" section inspired by the one
found in the gzip docs
- Corrects the descriptions for ``compresslevel`` and ``data``:
- ``compresslevel`` must be an `int`, not any number. For
instance, passing a float will raise ``TypeError``
- Notes that `data` must be bytes-like
(cherry picked from commit be6939fb02)
Co-authored-by: Brad <brad.solomon.1124@gmail.com>
"python3 -m test -jN ..." now continues the execution of next tests
when a worker process crash (CHILD_ERROR state). Previously, the test
suite stopped immediately. Use --failfast to stop at the first error.
Moreover, --forever now also implies --failfast.
(cherry picked from commit b0917df329)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
* A pointer in `PyInterpreterState_New()` could have been `NULL` when being dereferenced.
* Memory was leaked in `PyInterpreterState_New()` when taking some error-handling code path.
(cherry picked from commit 95d630e)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Update 'unicode' capitalization. 'Unicode' is a proper noun, and as such should be capitalized.
Changed multiple instances.
(cherry picked from commit 85225b6a58)
Co-authored-by: toonarmycaptain <toonarmycaptain@hotmail.com>