Author serhiy.storchaka
Recipients ned.deily, serhiy.storchaka
Date 2018-06-10.06:35:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
PyExceptionClass_Name() returns just the tp_name field, a pointer to immutable char array. tp_name had type "char *" in old Python versions, but it was changed to "const char *" in revision af68c874a6803b4e90b616077a602c0593719a1d.

But PyExceptionClass_Name() still casts tp_name to "char *". I think it would be better to return "const char *". It would be a breaking change, but seems most third-party code uses the result of PyExceptionClass_Name() in context where "const char *" is acceptable [1], and it is easy to add "const" in a variable declaration if the result is assigned to a variable (as in both cases of using PyExceptionClass_Name() in the CPython core).

Since several similar breaking changes were made in 3.7 (isee ssue28761 and issue28769), it would be nice to made this change in 3.7 too. But it may be too late for 3.7.

Date User Action Args
2018-06-10 06:36:34serhiy.storchakaunlinkissue33818 messages
2018-06-10 06:35:52serhiy.storchakasetrecipients: + serhiy.storchaka, ned.deily
2018-06-10 06:35:52serhiy.storchakasetmessageid: <>
2018-06-10 06:35:52serhiy.storchakalinkissue33818 messages
2018-06-10 06:35:51serhiy.storchakacreate