This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年10月31日 18:53 by lekma, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| Issue10271.diff | lekma, 2011年02月02日 13:19 | patch against py3k | review | |
| Issue10271.33.fix.diff | lekma, 2011年04月17日 13:50 | fix issue10271 | review | |
| Issue10271.33.test.diff | lekma, 2011年04月17日 13:51 | test for issue10271 | review | |
| Messages (11) | |||
|---|---|---|---|
| msg120080 - (view) | Author: (lekma) * | Date: 2010年10月31日 18:53 | |
Overriding warnings.showwarning() with a c/python module function (from a c/python module) doesn't work because warn_explicit() only allow PyFunction or PyMethod objects to be called (unfortunately c/python module functions are of type PyCFunction).
Suggested changes in _warnings.c (from py3k) - not tested at all:
from:
412 if (!PyMethod_Check(show_fxn) && !PyFunction_Check(show_fxn)) {
413 PyErr_SetString(PyExc_TypeError,
414 "warnings.showwarning() must be set to a "
415 "function or method");
to:
412 if (!PyCallable_Check(show_fxn)) {
413 PyErr_SetString(PyExc_TypeError,
414 "warnings.showwarning() must be set to a "
415 "callable");
|
|||
| msg127883 - (view) | Author: (lekma) * | Date: 2011年02月04日 10:46 | |
brett, is there any chance for this to make it in? |
|||
| msg127936 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2011年02月04日 20:20 | |
Not for 3.2.0, no as it's such a minor "fix". Chance this can go into 3.2.1, though. Definitely for 3.3. |
|||
| msg133927 - (view) | Author: (lekma) * | Date: 2011年04月17日 13:50 | |
- split the patch between the actual fix and the test - rewrote the test a little bit (I'm not sure it's even needed, hence the split) - rediff against 3.3 (should still apply cleanly on top of 3.2 (modulo offset)) |
|||
| msg136215 - (view) | Author: (lekma) * | Date: 2011年05月18日 09:29 | |
Is there anything else I should be doing? |
|||
| msg136230 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年05月18日 11:52 | |
Brett's been very busy with real life. Maybe someone else can commit this. |
|||
| msg136420 - (view) | Author: (lekma) * | Date: 2011年05月21日 06:14 | |
how should we go about that? |
|||
| msg140556 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年07月18日 02:18 | |
New changeset aaced3dcb858 by Brett Cannon in branch 'default': Make warnings accept a callable for showwarnings instead of http://hg.python.org/cpython/rev/aaced3dcb858 |
|||
| msg140557 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2011年07月18日 02:19 | |
Committed in 3.3. This cannot be backported as it widens the API and those could lead to subtle incompatibilities. |
|||
| msg140558 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年07月18日 02:26 | |
New changeset eaefb34fc3a1 by Brett Cannon in branch 'default': Add Misc/NEWS entry and relevant doc change for issue 10271. http://hg.python.org/cpython/rev/eaefb34fc3a1 |
|||
| msg140788 - (view) | Author: (lekma) * | Date: 2011年07月21日 06:07 | |
Thank you very much for your help |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:08 | admin | set | github: 54480 |
| 2011年07月21日 06:07:49 | lekma | set | messages: + msg140788 |
| 2011年07月18日 02:26:00 | python-dev | set | messages: + msg140558 |
| 2011年07月18日 02:19:13 | brett.cannon | set | status: open -> closed resolution: fixed messages: + msg140557 |
| 2011年07月18日 02:18:11 | python-dev | set | nosy:
+ python-dev messages: + msg140556 |
| 2011年07月16日 09:49:04 | ncoghlan | set | nosy:
+ ncoghlan |
| 2011年05月21日 06:14:59 | lekma | set | messages: + msg136420 |
| 2011年05月18日 11:52:46 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg136230 |
| 2011年05月18日 11:44:08 | daniel.urban | set | nosy:
+ daniel.urban |
| 2011年05月18日 09:29:59 | lekma | set | messages: + msg136215 |
| 2011年04月17日 13:51:15 | lekma | set | files: + Issue10271.33.test.diff |
| 2011年04月17日 13:50:38 | lekma | set | files:
+ Issue10271.33.fix.diff messages: + msg133927 versions: + Python 3.3 |
| 2011年02月04日 20:20:14 | brett.cannon | set | nosy:
brett.cannon, lekma messages: + msg127936 |
| 2011年02月04日 10:46:32 | lekma | set | nosy:
brett.cannon, lekma messages: + msg127883 |
| 2011年02月02日 13:19:06 | lekma | set | files:
+ Issue10271.diff nosy: brett.cannon, lekma keywords: + patch |
| 2010年10月31日 19:03:29 | brett.cannon | set | versions: - Python 2.6, Python 3.1, Python 2.7 |
| 2010年10月31日 19:03:15 | brett.cannon | set | assignee: brett.cannon nosy: + brett.cannon |
| 2010年10月31日 18:53:34 | lekma | create | |