[issue26476] Constness in _PyErr_BadInternalCall

2016-03-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue26476] Constness in _PyErr_BadInternalCall

2016-03-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e3526ab6a9b by Serhiy Storchaka in branch '2.7': Issue #26476: Fixed compilation error when use PyErr_BadInternalCall() in C++. https://hg.python.org/cpython/rev/0e3526ab6a9b -- nosy: +python-dev ___ Pyt

[issue26476] Constness in _PyErr_BadInternalCall

2016-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: OK, now I understand. Since _PyErr_BadInternalCall() is private function, we will not break any code. Since it is used only by the PyErr_BadInternalCall() macro and always called with string literal as an argument, C++ user can't use PyErr_BadInternalCall()

[issue26476] Constness in _PyErr_BadInternalCall

2016-03-03 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > CPython is written on C and provides C API. If you look at the title of https://docs.python.org/2/extending/extending.html clearly C++ extensions are also supported. > Even if change the signature of one function, this will not help much, > because a lot of

[issue26476] Constness in _PyErr_BadInternalCall

2016-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: CPython is written on C and provides C API. Even if change the signature of one function, this will not help much, because a lot of other functions require "char *" instead of "const char *". There is small disadvantage of changing the signature in a bugfix

[issue26476] Constness in _PyErr_BadInternalCall

2016-03-03 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > It is questionable wherever it should be backported to 2.7. It violates the C++ standard (for extension modules written in C++), so it's clearly a bug. -- ___ Python tracker __

[issue26476] Constness in _PyErr_BadInternalCall

2016-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Was already fixed in 84618b2064c1. It is questionable wherever it should be backported to 2.7. Most other "const" additions were applied only to the default branch (see issue25923, issue24436, issue1772673, issue9369, issue16369, issue12173, issue1419652 and

[issue26476] Constness in _PyErr_BadInternalCall

2016-03-03 Thread Jeroen Demeyer
New submission from Jeroen Demeyer: PyErr_BadInternalCall() calls _PyErr_BadInternalCall(__FILE__, __LINE__). Since __FILE__ is a string constant, the first argument of _PyErr_BadInternalCall should be a "const char*" instead of a "char*". This is a follow-up to #4949. Most of the patch from #