summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #4180: The warnings registries are now reset when the filters are ↵Antoine Pitrou2014-09-181-6/+35
| | | | modified.
* 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. ........
* | Merged revisions 72487-72488,72879 via svnmerge fromAlexandre Vassalotti2009-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72487 | jeffrey.yasskin | 2009-05-08 17:51:06 -0400 (Fri, 08 May 2009) | 7 lines PyCode_NewEmpty: Most uses of PyCode_New found by http://www.google.com/codesearch?q=PyCode_New are trying to build an empty code object, usually to put it in a dummy frame object. This patch adds a PyCode_NewEmpty wrapper which lets the user specify just the filename, function name, and first line number, instead of also requiring lots of code internals. ........ r72488 | jeffrey.yasskin | 2009-05-08 18:23:21 -0400 (Fri, 08 May 2009) | 13 lines Issue 5954, PyFrame_GetLineNumber: Most uses of PyCode_Addr2Line (http://www.google.com/codesearch?q=PyCode_Addr2Line) are just trying to get the line number of a specified frame, but there's no way to do that directly. Forcing people to go through the code object makes them know more about the guts of the interpreter than they should need. The remaining uses of PyCode_Addr2Line seem to be getting the line from a traceback (for example, http://www.google.com/codesearch/p?hl=en#u_9_nDrchrw/pygame-1.7.1release/src/base.c&q=PyCode_Addr2Line), which is replaced by the tb_lineno field. So we may be able to deprecate PyCode_Addr2Line entirely for external use. ........ r72879 | jeffrey.yasskin | 2009-05-23 19:23:01 -0400 (Sat, 23 May 2009) | 14 lines Issue #6042: lnotab-based tracing is very complicated and isn't documented very well. There were at least 3 comment blocks purporting to document co_lnotab, and none did a very good job. This patch unifies them into Objects/lnotab_notes.txt which tries to completely capture the current state of affairs. I also discovered that we've attached 2 layers of patches to the basic tracing scheme. The first layer avoids jumping to instructions that don't start a line, to avoid problems in if statements and while loops. The second layer discovered that jumps backward do need to trace at instructions that don't start a line, so it added extra lnotab entries for 'while' and 'for' loops, and added a special case for backward jumps within the same line. I replaced these patches by just treating forward and backward jumps differently. ........
* | Merged revisions 74040,74042 via svnmerge fromHirokazu Yamamoto2009-07-171-0/+2
|/ | | | | | | | | | | | | | 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. ........
* Merged revisions 70965 via svnmerge fromBrett Cannon2009-04-011-16/+30
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r70965 | brett.cannon | 2009-04-01 11:03:59 -0700 (Wed, 01 Apr 2009) | 5 lines _warnings was importing itself to get an attribute. That's bad if warnings gets called in a thread that was spawned by an import itself. Last part to close #1665206. ........
* Merged revisions 66748 via svnmerge fromChristian Heimes2008-10-021-3/+3
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r66748 | christian.heimes | 2008-10-02 21:47:50 +0200 (Thu, 02 Oct 2008) | 1 line Fixed a couple more C99 comments and one occurence of inline. ........ + another // comment in bytesobject
* The _warnings module did not properly handle cases where strings were not beingBrett Cannon2008-09-021-4/+12
| | | | | | | | passed in as the message to use for a warning. Fixed along with making the code more robust against other errors where return values were not checked. Closes issue 3639. Code review by Benjamin Peterson.
* Merge in r66135. Doing also required removing a stale DeprecationWarning alongBrett Cannon2008-09-021-40/+14
| | | | | with moving warnings.catch_warnings() over to keyword-only parameters for its constructor (as documented in the 2.6 docs).
* Rename PyUnicode_AsString -> _PyUnicode_AsString andMarc-André Lemburg2008-08-071-9/+9
| | | | | | | | | PyUnicode_AsStringAndSize -> _PyUnicode_AsStringAndSize to mark them for interpreter internal use only. We'll have to rework these APIs or create new ones for the purpose of accessing the UTF-8 representation of Unicode objects for 3.1.