| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
No longer import the re module if it is not needed.
(cherry picked from commit 41ec17e45d54473d32f543396293256f1581e44d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
| |
Ensure custom formatwarning function can receive line as positional argument.
Co-Authored-By: Tashrif Billah <tashrifbillah@gmail.com>
(cherry picked from commit be7c460fb50efe3b88a00281025d76acc62ad2fd)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
|
| |
|
|
|
|
|
|
| |
The warnings module now suggests to enable tracemalloc if the source
is specified, tracemalloc module is available, but tracemalloc is not
tracing memory allocations.
(cherry picked from commit 2c07c493d2eb45101312e3eb3a77f94d0c9cad1f)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
|
|
|
| |
Fixed also testing the "always" warning filter.
(cherry picked from commit b796e7dcdc24ff7ec53044af041254c83a8ace21)
Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
|
| |
|
|
|
|
|
| |
Fix test_warnings.test_module_globals() when python3 is run with
-Werror.
(cherry picked from commit e292b75e3ecdc6bbe81cda09de836dc9e27ab9e6)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
|
|
|
| |
Don't crash on warnings.warn_explicit() if module_globals is not a dict.
(cherry picked from commit b056562860c227bad2e0ba7cd3130e115c007768)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- primary change is to add a new default filter entry for
'default::DeprecationWarning:__main__'
- secondary change is an internal one to cope with plain
strings in the warning module's internal filter list
(this avoids the need to create a compiled regex object
early on during interpreter startup)
- assorted documentation updates, including many more
examples of configuring the warnings settings
- additional tests to ensure that both the pure Python and
the C accelerated warnings modules have the expected
default configuration
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
(#4534)
* Add most_recent_first parameter to tracemalloc.Traceback.format to allow
reversing the order of the frames in the output
* Reversed default sorting of tracemalloc.Traceback frames
* Allowed negative limit, truncating from the other side.
|
| |
|
|
|
|
|
| |
The warnings module doesn't leak memory anymore in the hidden
warnings registry for the "ignore" action of warnings filters.
The warn_explicit() function doesn't add the warning key to the
registry anymore for the "ignore" action.
|
| |
|
|
| |
__name__ global. (#3717)
|
| |
|
|
| |
warnings.warn_explicit. (#3219)
|
| |
|
|
|
| |
warnings.defaultaction. (#3496)
Patch by Oren Milman.
|
| |
|
|
| |
not a dictionary. (#3485)
|
| | |
|
| |
|
|
| |
bpo-26568, bpo-30812: Fix test_showwarnmsg_missing(): restore the
attribute after removing it.
|
| | |
|
| |
|
|
| |
The fix for catch_warnings() is the issue #28835 (not the issue #28089).
|
| |
|
|
|
| |
Issue #28089: Fix a regression introduced in warnings.catch_warnings(): call
warnings.showwarning() if it was overriden inside the context manager.
|
| |\ |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| | |
head and fix whitespace.
|
| |\ \
| |/ |
|
| | |
| |
| |
| |
| | |
Check the user warning in test_error_after_default() to not pollute the output,
and check the warning logged into stderr.
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
Based on patch by Alex Shkop.
|
| | |
| |
| |
| | |
Use -Wd comment line option to log the ResourceWarning.
|
| | |
| |
| |
| | |
Use -Wd comment line option to log the ResourceWarning.
|
| |\ \
| |/
| |
| |
| |
| | |
Issue #21925: warnings.formatwarning() now catches exceptions when calling
linecache.getline() and tracemalloc.get_object_traceback() to be able to log
ResourceWarning emitted late during the Python shutdown process.
|
| | |
| |
| |
| |
| |
| | |
Issue #21925: warnings.formatwarning() now catches exceptions on
linecache.getline(...) to be able to log ResourceWarning emitted late during
the Python shutdown process.
|
| | |
| |
| |
| |
| | |
test_warnings: only run test_improper_option() and test_warnings_bootstrap()
once. The unit test doesn't depend on self.module.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Issue #26567: normalize newlines in test_tracemalloc.
|
| | |
| |
| |
| | |
Issue #26567.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #26567:
* Add a new function PyErr_ResourceWarning() function to pass the destroyed
object
* Add a source attribute to warnings.WarningMessage
* Add warnings._showwarnmsg() which uses tracemalloc to get the traceback where
source object was allocated.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #26568: add new _showwarnmsg() and _formatwarnmsg() functions to the
warnings module.
The C function warn_explicit() now calls warnings._showwarnmsg() with a
warnings.WarningMessage as parameter, instead of calling warnings.showwarning()
with multiple parameters.
_showwarnmsg() calls warnings.showwarning() if warnings.showwarning() was
replaced. Same for _formatwarnmsg(): call warnings.formatwarning() if it was
replaced.
|
| |/ |
|
| | |
|
|
|
by the warnings.warn(stacklevel=) parameter.
|