[issue8113] PyUnicode_AsUnicode doesn't check for NULL pointer

2010-03-11 Thread Lorenz Quack
Lorenz Quack added the comment: Thanks for the fast replies. I used to groups some Python calls together and check in the end if any of them failed in one exception handling block. I will now check every call individually. I will open a new bug for documentation fixes where there is now info

[issue8113] PyUnicode_AsUnicode doesn't check for NULL pointer

2010-03-10 Thread STINNER Victor
STINNER Victor added the comment: > I just looked at the code for PyFloat_AsDouble and it checks for NULL pointers It's just a little help for developers: it will raise the ugly TypeError("bad argument type for built-in operation") and returns -1. It's never a good idea to pass NULL to a func

[issue8113] PyUnicode_AsUnicode doesn't check for NULL pointer

2010-03-10 Thread Lorenz Quack
Lorenz Quack added the comment: I thought that the CamelCase C-functions like PyUnicode_AsUnicode would check for errors like this and if you don't want error checking you can use the capitalized versions like PyUnicode_AS_UNICODE. I just looked at the code for PyFloat_AsDouble and it checks f

[issue8113] PyUnicode_AsUnicode doesn't check for NULL pointer

2010-03-10 Thread Benjamin Peterson
Benjamin Peterson added the comment: Why is that a bug? You shouldn't pass a NULL argument. -- nosy: +benjamin.peterson priority: -> low ___ Python tracker ___ _

[issue8113] PyUnicode_AsUnicode doesn't check for NULL pointer

2010-03-10 Thread Lorenz Quack
New submission from Lorenz Quack : The C-API function "PyUnicode_AsUnicode(PyObject *unicode)" does not check the argument for NULL pointers. It passes it directly to the macro "PyUnicode_Check(op)" which then crashes when trying to access "Py_TYPE(op)". I marked this as Python 2.7 because I