summaryrefslogtreecommitdiff
path: root/Python/_warnings.c
AgeCommit message (Collapse)AuthorLines
2015-05-03be more robust against the filters list changing under us (closes #24096)Benjamin Peterson-6/+16
2015-04-13Issue #23731: Implement PEP 488.Brett Cannon-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.
2014-09-18Issue #4180: The warnings registries are now reset when the filters are ↵Antoine Pitrou-6/+35
modified.
2014-09-18Issue #4180: The warnings registries are now reset when the filters are ↵Antoine Pitrou-6/+35
modified.
2014-07-11Issue #16382: Improve exception message of warnings.warn() for bad category.Berker Peksag-6/+7
Initial patch by Phil Elson.
2013-11-07Issue #19512, #19515: remove shared identifiers, move identifiers where theyVictor Stinner-2/+4
are used. Move also _Py_IDENTIFIER() defintions to the top in modified files to remove identifiers duplicated in the same file.
2013-11-06Issue #19512: add some common identifiers to only create common strings once,Victor Stinner-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.
2013-11-01Close #19442: warn_explicit() does nothing when called late during Python ↵Victor Stinner-9/+9
shutdown After more tests, I now think that it is the safest option.
2013-10-31Issue #19437: Fix show_warning() of _warnings, stop at the first error to notVictor Stinner-10/+16
call a Python function with an exception set
2013-10-31Issue #19437: Fix get_filter() from _warnings, don't call PyObject_IsSubclass()Victor Stinner-2/+10
with an exception set
2013-10-30Issue #19442: Fix warnings emitted during Python shutdownVictor Stinner-5/+12
Warnings may be emitted during Python shutdown, like "unclosed file XXX". During shutdown, globals()['__main__'] may be None.
2013-10-29Issue #19424: Fix the warnings module to accept filename containing surrogateVictor Stinner-46/+54
characters.
2013-10-28Issue #19421: fix a check in warnings.warn() to be able to use it during PythonVictor Stinner-1/+3
finalization. sys.argv is set to None during Python finalization: add PyList_Check() to avoid a crash in PyList_Size().
2013-08-26Close #11619: The parser and the import machinery do not encode UnicodeVictor Stinner-11/+20
filenames anymore on Windows.
2013-07-16Issue #18408: Fix show_warning(), clear also the exception raised byVictor Stinner-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.
2013-05-08Issue #1545463: At shutdown, defer finalization of codec modules so that ↵Antoine Pitrou-2/+45
stderr remains usable. (should fix Windows buildbot failures on test_gc)
2012-01-18Finally fix all test_capi refleaksAntoine Pitrou-9/+16
2012-01-11remove some usage of Py_UNICODE_TOUPPER/LOWERBenjamin Peterson-4/+5
2011-12-09Merge 3.2Florent Xicluna-1/+0
2011-12-09Remove obsolete py3k comment.Florent Xicluna-1/+0
2011-11-21Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()Victor Stinner-5/+5
And PyUnicode_GetSize() => PyUnicode_GetLength()
2011-11-07Make _PyUnicode_FromId return borrowed references.Martin v. Löwis-2/+0
http://mail.python.org/pipermail/python-dev/2011-November/114347.html
2011-10-14Port SetAttrString/HasAttrString to SetAttrId/GetAttrId.Martin v. Löwis-17/+15
2011-10-14Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis-2/+2
2011-10-10Use identifier API for PyObject_GetAttrString.Martin v. Löwis-1/+2
2011-10-09Add API for static strings, primarily good for identifiers.Martin v. Löwis-1/+2
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
2011-10-06Fix _warnings.c: make the filename string readyVictor Stinner-3/+10
2011-09-28Implement PEP 393.Martin v. Löwis-7/+9
2011-07-17Make warnings accept a callable for showwarnings instead ofBrett Cannon-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.
2011-07-04start out this branch always with filename NULLBenjamin Peterson-1/+1
2011-07-03plug refleakBenjamin Peterson-0/+1
2011-07-04Issue #12467: warnings: fix a race condition if a warning is emitted atVictor Stinner-1/+1
shutdown, if globals()['__file__'] is None.
2011-03-15#11515: Merge with 3.1.Ezio Melotti-1/+1
2011-03-15#11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti-1/+1
2010-12-27Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystemVictor Stinner-1/+1
encoding instead of UTF-8.
2010-10-24Add a new warning gategory, ResourceWarning, as discussed on python-dev. It ↵Georg Brandl-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.
2010-09-04_warnings exposed two variables with the name 'default_action' andBrett Cannon-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.
2010-08-13Issue #9425: Create PyErr_WarnFormat() functionVictor Stinner-6/+40
Similar to PyErr_WarnEx() but use PyUnicode_FromFormatV() to format the warning message. Strip also some trailing spaces.
2010-08-08Issue #9425: fix setup_context() for non-ascii filenamesVictor Stinner-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.
2010-06-28Merged revisions 77402,77505,77510 via svnmerge fromBenjamin Peterson-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. ........
2010-06-17Merged revisions 82059,82061 via svnmerge fromVictor Stinner-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 ........
2010-06-17Issue #6543: Write the traceback in the terminal encoding instead of utf-8.Victor Stinner-2/+1
Fix the encoding of the modules filename. Reindent also traceback.h, just because I hate tabs :-)
2010-05-20Recorded merge of revisions 81364 via svnmerge fromVictor Stinner-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. ........
2010-05-19Issue #8766: Initialize _warnings module before importing the first module.Victor Stinner-1/+1
Fix a crash if an empty directory called "encodings" exists in sys.path.
2010-05-09Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou-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. ........ ................
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-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. ........
2009-07-21Merged revisions 72487-72488,72879 via svnmerge fromAlexandre Vassalotti-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. ........
2009-07-17Merged revisions 74046 via svnmerge fromHirokazu Yamamoto-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. ........ ................
2009-07-17Merged revisions 74040,74042 via svnmerge fromHirokazu Yamamoto-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. ........
2009-04-01Merged revisions 70965 via svnmerge fromBrett Cannon-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. ........