Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2062937a
Commit
2062937a
authored
Oct 24, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation about the default warnings filters.
parent
08be72d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
Doc/library/warnings.rst
Doc/library/warnings.rst
+21
-3
No files found.
Doc/library/warnings.rst
View file @
2062937a
...
...
@@ -94,9 +94,6 @@ User code can define additional warning categories by subclassing one of the
standard warning categories. A warning category must always be a subclass of
the :exc:`Warning` class.
.. versionchanged:: 3.2
:exc:`DeprecationWarning` is ignored by default.
.. _warning-filter:
...
...
@@ -157,6 +154,27 @@ interpreter command line. The interpreter saves the arguments for all
are ignored, after printing a message to ``sys.stderr``).
Default Warning Filters
~~~~~~~~~~~~~~~~~~~~~~~
By default, Python installs several warning filters, which can be overridden by
the command-line options passed to :option:`-W` and calls to
:func:`filterwarnings`.
* :exc:`DeprecationWarning` and :exc:`PendingDeprecationWarning`, and
:exc:`ImportWarning` are ignored.
* :exc:`BytesWarning` is ignored unless the :option:`-b` option is given once or
twice; in this case this warning is either printed (``-b``) or turned into an
exception (``-bb`).
* :exc:`ResourceWarning` is ignored unless Python was built in debug mode.
.. versionchanged:: 3.2
:exc:`DeprecationWarning` is now ignored by default in addition to
:exc:`PendingDeprecationWarning`.
.. _warning-suppress:
Temporarily Suppressing Warnings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment