summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #24305: Prevent import subsystem stack frames from being countedLarry Hastings2015-09-061-2/+70
| | | | by the warnings.warn(stacklevel=) parameter.
* merge 3.4 (#24096)Benjamin Peterson2015-05-031-10/+27
|\
| * merge 3.3 (#24096)Benjamin Peterson2015-05-031-10/+27
| |\
| | * be more robust against the filters list changing under us (closes #24096)Benjamin Peterson2015-05-031-6/+16
| | |
* | | Issue #23731: Implement PEP 488.Brett Cannon2015-04-131-3/+2
| | | | | | | | | | | | | | | | | | The concept of .pyo files no longer exists. Now .pyc files have an optional `opt-` tag which specifies if any extra optimizations beyond the peepholer were applied.
* | | Issue #4180: The warnings registries are now reset when the filters are ↵Antoine Pitrou2014-09-181-6/+35
|\ \ \ | |/ / | | | | | | modified.
| * | Issue #4180: The warnings registries are now reset when the filters are ↵Antoine Pitrou2014-09-181-6/+35
| | | | | | | | | | | | modified.
* | | Issue #16382: Improve exception message of warnings.warn() for bad category.Berker Peksag2014-07-111-6/+7
|/ / | | | | | | Initial patch by Phil Elson.
* | Issue #19512, #19515: remove shared identifiers, move identifiers where theyVictor Stinner2013-11-071-2/+4
| | | | | | | | | | | | | | are used. Move also _Py_IDENTIFIER() defintions to the top in modified files to remove identifiers duplicated in the same file.
* | Issue #19512: add some common identifiers to only create common strings once,Victor Stinner2013-11-061-2/+2
| | | | | | | | | | | | | | instead of creating temporary Unicode string objects Add also more identifiers in pythonrun.c to avoid temporary Unicode string objets for the interactive interpreter.
* | Close #19442: warn_explicit() does nothing when called late during Python ↵Victor Stinner2013-10-311-9/+9
| | | | | | | | | | | | shutdown After more tests, I now think that it is the safest option.
* | Issue #19437: Fix show_warning() of _warnings, stop at the first error to notVictor Stinner2013-10-311-10/+16
| | | | | | | | call a Python function with an exception set
* | Issue #19437: Fix get_filter() from _warnings, don't call PyObject_IsSubclass()Victor Stinner2013-10-311-2/+10
| | | | | | | | with an exception set
* | Issue #19442: Fix warnings emitted during Python shutdownVictor Stinner2013-10-291-5/+12
| | | | | | | | | | Warnings may be emitted during Python shutdown, like "unclosed file XXX". During shutdown, globals()['__main__'] may be None.
* | Issue #19424: Fix the warnings module to accept filename containing surrogateVictor Stinner2013-10-291-47/+55
| | | | | | | | characters.
* | Issue #19421: fix a check in warnings.warn() to be able to use it during PythonVictor Stinner2013-10-281-1/+3
| | | | | | | | | | | | | | finalization. sys.argv is set to None during Python finalization: add PyList_Check() to avoid a crash in PyList_Size().
* | Close #11619: The parser and the import machinery do not encode UnicodeVictor Stinner2013-08-261-11/+20
| | | | | | | | filenames anymore on Windows.
* | Issue #18408: Fix show_warning(), clear also the exception raised byVictor Stinner2013-07-151-3/+3
| | | | | | | | | | | | | | | | _Py_DisplaySourceLine() For example, _PyGC_DumpShutdownStats() calls PyErr_WarnExplicitFormat() while the import machinery does not work anymore, _Py_DisplaySourceLine() fails when trying to import the io module.
* | Issue #1545463: At shutdown, defer finalization of codec modules so that ↵Antoine Pitrou2013-05-081-2/+45
|/ | | | | | stderr remains usable. (should fix Windows buildbot failures on test_gc)
* Finally fix all test_capi refleaksAntoine Pitrou2012-01-181-9/+16
|
* remove some usage of Py_UNICODE_TOUPPER/LOWERBenjamin Peterson2012-01-121-4/+5
|
* Merge 3.2Florent Xicluna2011-12-091-1/+0
|\
| * Remove obsolete py3k comment.Florent Xicluna2011-12-091-1/+0
| |
* | Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()Victor Stinner2011-11-211-5/+5
| | | | | | | | And PyUnicode_GetSize() => PyUnicode_GetLength()
* | Make _PyUnicode_FromId return borrowed references.Martin v. Löwis2011-11-071-2/+0
| | | | | | | | http://mail.python.org/pipermail/python-dev/2011-November/114347.html
* | Port SetAttrString/HasAttrString to SetAttrId/GetAttrId.Martin v. Löwis2011-10-141-17/+15
| |
* | Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-2/+2
| |
* | Use identifier API for PyObject_GetAttrString.Martin v. Löwis2011-10-101-1/+2
| |
* | Add API for static strings, primarily good for identifiers.Martin v. Löwis2011-10-091-1/+2
| | | | | | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
* | Fix _warnings.c: make the filename string readyVictor Stinner2011-10-061-3/+10
| |
* | Implement PEP 393.Martin v. Löwis2011-09-281-7/+9
| |
* | Make warnings accept a callable for showwarnings instead ofBrett Cannon2011-07-181-2/+2
|/ | | | | | | restricting itself to just functions and methods (which allows built-in functions to be used, etc.). Closes issue #10271. Thanks to lekma for the bug report.
* start out this branch always with filename NULLBenjamin Peterson2011-07-051-1/+1
|
* plug refleakBenjamin Peterson2011-07-041-0/+1
|
* Issue #12467: warnings: fix a race condition if a warning is emitted atVictor Stinner2011-07-041-1/+1
| | | | shutdown, if globals()['__file__'] is None.
* #11515: Merge with 3.1.Ezio Melotti2011-03-151-1/+1
|\
| * #11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-151-1/+1
| |
| * Merged revisions 82059,82061 via svnmerge fromVictor Stinner2010-06-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82059 | victor.stinner | 2010-06-18 01:08:50 +0200 (ven., 18 juin 2010) | 5 lines Issue #6543: Write the traceback in the terminal encoding instead of utf-8. Fix the encoding of the modules filename. Reindent also traceback.h, just because I hate tabs :-) ........ r82061 | victor.stinner | 2010-06-18 01:17:37 +0200 (ven., 18 juin 2010) | 2 lines Issue #6543: Mention the author of the patch, Amaury Forgeot d'Arc ........
| * Recorded merge of revisions 81364 via svnmerge fromVictor Stinner2010-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81364 | victor.stinner | 2010-05-19 22:40:50 +0200 (mer., 19 mai 2010) | 3 lines Issue #8766: Initialize _warnings module before importing the first module. Fix a crash if an empty directory called "encodings" exists in sys.path. ........
| * Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou2010-05-091-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines Recorded merge of revisions 81029 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........ ................
| * Merged revisions 74046 via svnmerge fromHirokazu Yamamoto2009-07-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r74046 | hirokazu.yamamoto | 2009-07-17 15:55:42 +0900 | 13 lines Merged revisions 74040,74042 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74040 | hirokazu.yamamoto | 2009-07-17 15:20:46 +0900 | 1 line Issue #6415: Fixed warnings.warn sagfault on bad formatted string. ........ r74042 | hirokazu.yamamoto | 2009-07-17 15:26:54 +0900 | 1 line NEWS about r74040. ........ ................
* | Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystemVictor Stinner2010-12-271-1/+1
| | | | | | | | encoding instead of UTF-8.
* | Add a new warning gategory, ResourceWarning, as discussed on python-dev. It ↵Georg Brandl2010-10-241-3/+19
| | | | | | | | | | | | | | | | is silent by default, except when configured --with-pydebug. Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
* | _warnings exposed two variables with the name 'default_action' andBrett Cannon2010-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | 'once_registry'. This is bad as the warnings module had variables named 'defaultaction' and 'onceregistry' which are what people should be looking at (technically those variables shouldn't be mucked with as they are undocumented, but we all know better than to believe that isn't happening). So the variables from _warnings have been renamed to come off as private and to avoid confusion over what variable should be used. Closes issue #9766. Thanks to Antoine Pitrou for the discovery.
* | Issue #9425: Create PyErr_WarnFormat() functionVictor Stinner2010-08-131-6/+40
| | | | | | | | | | | | | | Similar to PyErr_WarnEx() but use PyUnicode_FromFormatV() to format the warning message. Strip also some trailing spaces.
* | Issue #9425: fix setup_context() for non-ascii filenamesVictor Stinner2010-08-081-13/+11
| | | | | | | | | | | | | | | | | | | | setup_context() replaces .pyc or .pyo filename suffix by .py, but it didn't work if the filename contains a non-ascii character because the function used the wrong unit for the length (number of characters instead of the number of bytes). With this patch, it uses unicode filenames instead of bytes filenames, to fix the bug and to be fully unicode compliant.
* | Merged revisions 77402,77505,77510 via svnmerge fromBenjamin Peterson2010-06-281-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77402 | brett.cannon | 2010-01-09 20:56:19 -0600 (Sat, 09 Jan 2010) | 12 lines DeprecationWarning is now silent by default. This was originally suggested by Guido, discussed on the stdlib-sig mailing list, and given the OK by Guido directly to me. What this change essentially means is that Python has taken a policy of silencing warnings that are only of interest to developers by default. This should prevent users from seeing warnings which are triggered by an application being run against a new interpreter before the app developer has a chance to update their code. Closes issue #7319. Thanks to Antoine Pitrou, Ezio Melotti, and Brian Curtin for helping with the issue. ........ r77505 | brett.cannon | 2010-01-14 14:00:28 -0600 (Thu, 14 Jan 2010) | 7 lines The silencing of DeprecationWarning was not taking -3 into consideration. Since Py3K warnings are DeprecationWarning by default this was causing -3 to essentially be a no-op. Now DeprecationWarning is only silenced if -3 is not used. Closes issue #7700. Thanks Ezio Melotti and Florent Xicluna for patch help. ........ r77510 | brett.cannon | 2010-01-14 19:31:45 -0600 (Thu, 14 Jan 2010) | 1 line Remove C++/C99-style comments. ........
* | Issue #6543: Write the traceback in the terminal encoding instead of utf-8.Victor Stinner2010-06-171-2/+1
| | | | | | | | | | | | Fix the encoding of the modules filename. Reindent also traceback.h, just because I hate tabs :-)
* | Issue #8766: Initialize _warnings module before importing the first module.Victor Stinner2010-05-191-1/+1
| | | | | | | | Fix a crash if an empty directory called "encodings" exists in sys.path.
* | Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-40/+40
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........