New submission from Michael Ensslin:

The prototype for the public API function _PyTraceback_Add is declared

_PyTraceback_Add(char *, char *, int);

Internally, its char * arguments are passed verbatim to PyCode_NewEmpty, which 
takes const char * arguments.

The missing 'const' qualifier for the arguments of _PyTraceback_Add thus serves 
no purpose, and means that C++ code can't invoke the method with const char * 
arguments.

I've attached a proposed patch.

I can't think of any negative consequences from adding the 'const' qualifier 
(famous last words).

----------
components: Interpreter Core
files: const.patch
keywords: patch
messages: 245185
nosy: mic-e
priority: normal
severity: normal
status: open
title: _PyTraceback_Add has no const qualifier for its char * arguments
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39685/const.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24436>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to