[issue1631171] implement warnings module in C

2008-04-12 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Committed in revision 62303. -- resolution: -> accepted status: pending -> closed _ Tracker <[EMAIL PROTECTED]> _ __

[issue1631171] implement warnings module in C

2008-04-01 Thread Neal Norwitz
Neal Norwitz <[EMAIL PROTECTED]> added the comment: On Tue, Apr 1, 2008 at 6:14 AM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > Brett Cannon <[EMAIL PROTECTED]> added the comment: > > Neal's issues are addressed in this patch. I also finally filled out > warnings.h. The only thing that I didn'

[issue1631171] implement warnings module in C

2008-04-01 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Attached should have everything, including a pure Python fallback. As soon as the next alpha is out I will apply. -- status: open -> pending Added file: http://bugs.python.org/file9920/c_warnings.diff _

[issue1631171] implement warnings module in C

2008-04-01 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9917/c_warnings.diff _ Tracker <[EMAIL PROTECTED]> _ __

[issue1631171] implement warnings module in C

2008-04-01 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9761/c_warnings.diff _ Tracker <[EMAIL PROTECTED]> _ __

[issue1631171] implement warnings module in C

2008-04-01 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Neal's issues are addressed in this patch. I also finally filled out warnings.h. The only thing that I didn't deal with is Neal's worry of exposing _PyWarnings_Init(). It is not explicitly exported anywhere as part of the API so I am not sure

[issue1631171] implement warnings module in C

2008-04-01 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: After all the threats about checking in code that break stuff, I am not about to check this in. =) I will get to the changes when I can and then commit after the alpha. -- assignee: nnorwitz -> brett.cannon __

[issue1631171] implement warnings module in C

2008-03-31 Thread Neal Norwitz
Neal Norwitz <[EMAIL PROTECTED]> added the comment: I didn't realize this was waiting for me. You should have just checked it in, that would have gotten me to review faster. :-) pythonrun.c: * Should PyModule_GetWarningsModule() return a valid pointer? * The code below crashes. Need to XDECR

[issue1631171] implement warnings module in C

2008-03-31 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: On another note, the warnings module should be made to work with or without _warnings. that way IronPython, Jython, and PyPy won't have to re- implement stuff. This also means that test cases need to be changed to test this. -- priori

[issue1631171] implement warnings module in C

2008-03-18 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Attached is what I think is a completely working version of warnings implemented in a mixture of C and Python. I am not worrying about documenting the new C APIs I had to add since they are pretty specific to internal stuff. Probably should a

[issue1631171] implement warnings module in C

2008-03-18 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9667/c_warnings.diff _ Tracker <[EMAIL PROTECTED]> _ __

[issue1631171] implement warnings module in C

2008-03-18 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9490/c_warnings.diff _ Tracker <[EMAIL PROTECTED]> _ __

[issue1631171] implement warnings module in C

2008-03-13 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Add tests for the 'line' argument to formatwarning() and showwarning(). Added file: http://bugs.python.org/file9667/c_warnings.diff _ Tracker <[EMAIL PROTECTED]> ___

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file8858/_warnings.diff _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list ma

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file8783/warnings.diff _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list mai

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file8772/test_warnings.py _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file8565/_warnings.c _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list maili

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file8557/_warnings.c _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list maili

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file8496/c_warnings.diff _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list m

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file8495/_warnings.c _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list maili

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file7709/_warnings.c _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list maili

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Changes by Brett Cannon: Removed file: http://bugs.python.org/file7708/c-warnings.diff _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list m

[issue1631171] implement warnings module in C

2008-02-22 Thread Brett Cannon
Brett Cannon added the comment: Patch that has been brought up-to-date with r60968. No new work, though. Added file: http://bugs.python.org/file9490/c_warnings.diff _ Tracker <[EMAIL PROTECTED]> __

[issue1631171] implement warnings module in C

2007-11-29 Thread Brett Cannon
Brett Cannon added the comment: I see two ways of implementing the fetching of a source code line from __loader__.get_source(). One is to do it in Python. We have a function provided that can suppress the second line of output from a warning and just handle it in Python code. That has the requ

[issue1631171] implement warnings module in C

2007-11-22 Thread Brett Cannon
Brett Cannon added the comment: Implementing warn_explicit() is going to be troublesome with the new module_globals argument. It requires not only to go through the hassle of looking for a loader and calling get_source(), but it will most likely require reworking the traceback function introduce

[issue1631171] implement warnings module in C

2007-11-18 Thread Brett Cannon
Brett Cannon added the comment: This version of test_warnings has tests for _warnings.c. It currently is failing as the second line of output for warnings has not been implemented yet for _warnings.c. But all the specified tests in my last comment have now been implemented. Added file: http://

[issue1631171] implement warnings module in C

2007-11-15 Thread Brett Cannon
Changes by Brett Cannon: -- assignee: nnorwitz -> brett.cannon _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list mailing list Uns

[issue1631171] implement warnings module in C

2007-11-09 Thread Christian Heimes
Changes by Christian Heimes: -- nosy: +tiran _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue1631171] implement warnings module in C

2007-10-30 Thread Neal Norwitz
Neal Norwitz added the comment: I think Brett summarized the issues well. I can't think of anything else that seems to need doing. _ Tracker <[EMAIL PROTECTED]> _ __

[issue1631171] implement warnings module in C

2007-10-18 Thread Brett Cannon
Brett Cannon added the comment: Regression test suite now passes. =) Had to add the support for when warnings.showwarning() is set and a bug in PyErr_WarnExplicit() where a NULL value for the module name was not being allowed. Couple things still left to implement. One is the second output li

[issue1631171] implement warnings module in C

2007-10-17 Thread Neal Norwitz
Changes by Neal Norwitz: -- assignee: nnorwitz -> brett.cannon _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list mailing list Uns

[issue1631171] implement warnings module in C

2007-10-17 Thread Neal Norwitz
Neal Norwitz added the comment: I think this is good enough for now. The approach will probably stand even if the details change. Go for it! _ Tracker <[EMAIL PROTECTED]> _ ___

[issue1631171] implement warnings module in C

2007-10-16 Thread Brett Cannon
Brett Cannon added the comment: Attached is a new version of _warnings.c that checks to see if 'warnings' has been imported, and if so, uses the attributes from that module for onceregistry and 'filters'. I did it in such a way so that 'warnings' is in no way required nor imported through checki

[issue1631171] implement warnings module in C

2007-10-14 Thread Brett Cannon
Brett Cannon added the comment: So the descriptor idea didn't work. Another idea is to have the C code that relies on attributes on warnings that are allowed to change have an initial check for warnings, and if that fails to fall back on C code. That way the module can still be completely self-

[issue1631171] implement warnings module in C

2007-10-09 Thread Brett Cannon
Brett Cannon added the comment: I figured out why the tests are all failing; the C code does not call back into the Python 'warnings' wrapper. For instance, warn_explicit in the C code does not ever try to use a user-provided showwarning() function. This causes the tests to fail as they rely on

[issue1631171] implement warnings module in C

2007-10-09 Thread Brett Cannon
Brett Cannon added the comment: I just tried Neal's version of _warnings.c and it has the same failures, so they are not my fault. =) _ Tracker <[EMAIL PROTECTED]> _ ___

[issue1631171] implement warnings module in C

2007-10-08 Thread Brett Cannon
Changes by Brett Cannon: _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/optio

[issue1631171] implement warnings module in C

2007-10-08 Thread Brett Cannon
Brett Cannon added the comment: I have uploaded my touched up version of _warnings.c . I also have a new diff since the old one did not apply cleanly (test_warnings didn't get patched nor did PCbuild8). It also lacked the changes needed to Modules/config.c . It is still not complete, though.

[issue1631171] implement warnings module in C

2007-09-30 Thread Brett Cannon
Changes by Brett Cannon: -- assignee: -> brett.cannon nosy: +brett.cannon _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list maili