summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-101-1/+1
|\ | | | | | | in places where Py_DECREF was used.
| * Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-101-1/+1
| | | | | | | | in places where Py_DECREF was used.
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-1/+1
|\ \ | |/
| * Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-1/+1
| |
* | get_warnings_attr(): Fix coverity warningVictor Stinner2016-03-231-4/+3
| | | | | | | | | | Don't check if the dict key exists before getting the key. Instead get the key and handle error.
* | _warnings.warn_explicit(): try to import warningsVictor Stinner2016-03-221-14/+36
| | | | | | | | | | | | Issue #26592: _warnings.warn_explicit() now tries to import the warnings module (Python implementation) if the source parameter is set to be able to log the traceback where the source was allocated.
* | Add a source parameter to warnings.warn()Victor Stinner2016-03-221-5/+6
| | | | | | | | | | | | | | | | Issue #26604: * Add a new optional source parameter to _warnings.warn() and warnings.warn() * Modify asyncore, asyncio and _pyio modules to set the source parameter when logging a ResourceWarning warning
* | On ResourceWarning, log traceback where the object was allocatedVictor Stinner2016-03-191-29/+62
| | | | | | | | | | | | | | | | | | | | 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.
* | Add _showwarnmsg() and _formatwarnmsg() to warningsVictor Stinner2016-03-181-25/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-251-1/+1
|/ | | | private functions.
* Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-2/+1
| | | | macro Py_SETREF.
* 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. ........