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.

classification
Title: Constness in PyErr_NewException
Type: Stage:
Components: Interpreter Core Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, eckhardt, inducer, jdemeyer, loewis, sebastinas, terry.reedy
Priority: normal Keywords: easy

Created on 2009-01-14 18:04 by inducer, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-2.7-const-error.1.patch eckhardt, 2009-01-14 19:41 patch review
Messages (8)
msg79868 - (view) Author: Andreas Kloeckner (inducer) Date: 2009-01-14 18:04
The "name" argument to PyErr_NewException() should be changed from "char
*" to "const char *". Since the rest of pyerrors.h is const-correct,
this seems like an omission.
msg79871 - (view) Author: Ulrich Eckhardt (eckhardt) Date: 2009-01-14 19:41
It's not just that function, at least not in trunk. There are also 
PyErr_SetFromErrnoWithFilename, PyErr_SetFromErrnoWithUnicodeFilename 
and _PyErr_BadInternalCall which should be made const correct, see 
attached patch for trunk.

This patch also fixes some inconsistencies between the documentation 
and warning support functions.
msg112687 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-03 21:18
Martin, do you agree with the premise of this issue?

The patch consists of adding 'const' in about 6 places in code and corresponding 6 places in capi doc.
msg118914 - (view) Author: Andreas Kloeckner (inducer) Date: 2010-10-17 03:48
ping?
msg118957 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-10-17 17:58
Assuming the patch doesn't cause warnings on the compilers that we use, it looks fine to me.
msg137678 - (view) Author: Andreas Kloeckner (inducer) Date: 2011-06-05 03:20
ping?
msg137680 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-06-05 03:38
This patch is not applicable anymore to 3.x.
msg261157 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2016-03-03 10:25
Follow-up: #26476
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49199
2016-03-03 10:25:47jdemeyersetnosy: + jdemeyer
messages: + msg261157
2011-06-05 03:38:30benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg137680

resolution: out of date
2011-06-05 03:20:09inducersetmessages: + msg137678
2010-10-17 17:58:05loewissetmessages: + msg118957
2010-10-17 03:48:04inducersetmessages: + msg118914
2010-08-03 21:18:34terry.reedysetversions: + Python 3.1, Python 3.2, - Python 2.6, Python 2.5, Python 3.0
nosy: + loewis, terry.reedy

messages: + msg112687

keywords: + easy, - patch
2009-06-22 13:58:54inducersetversions: + Python 2.7
2009-01-16 16:43:39sebastinassetnosy: + sebastinas
2009-01-14 19:41:54eckhardtsetfiles: + python-2.7-const-error.1.patch
nosy: + eckhardt
messages: + msg79871
keywords: + patch
2009-01-14 18:04:58inducercreate