[issue28295] PyUnicode_AsUCS4 doc and impl conflict on exception

Serhiy Storchaka report at bugs.python.org
Sun Oct 2 13:39:02 EDT 2016


Serhiy Storchaka added the comment:

The remaining question is what should be the type of the exception. ValueError is documented exception, but SystemError is actually raised exception (and it always was raised). PyUnicode_AsUCS4() is used 6 times in 3 files in CPython code, and it should never raise this exception. PyUnicode_AsUCS4() is in public API an can be used in third party code. Seems raising this exception can be caused only by programming error in C extension. SystemError is right exception in this case.

It looks to me that the code is correct and the documentation should be fixed to match the code.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28295>
_______________________________________


More information about the Python-bugs-list mailing list