Issue with PyUnicodeObject type variables
Stefan Behnel
stefan_ml at behnel.de
Mon May 17 06:27:05 EDT 2010
mathan kumar, 17.05.2010 12:16:
> From: Stefan Behnel
>> Doesn't surprise me at all. Could you make sure this is the code you are
>> using? Especially the names 'p' and 'path'? And that you are initialising
>> neither of the two in your code?
>
> Tat was a typo mistake instead of *p pls consider *path as follows.
>
> PyUnicodeObject *path;
> if (PyUnicode_Check(path)) {
Again, you are not initialising the pointer, so it contains an arbitrary
value when you run the program. You are lucky that it gives you a result at
all, instead of just plain crashing.
You do not seem to have much experience with C. Is there any reason why you
want to use it? Or is this just for curiosity?
Stefan
More information about the Python-list
mailing list