fputs in tp_print crashes under Win32

Petr Gotthard petr.gotthard at centrum.cz
Wed Nov 12 05:58:05 EST 2008


Hello,
my C++ extension crashes under Win32 when the tp_print is called.

It crashes with both Python 2.5.2 and 2.6. The crash occurs in
system32\ntdll.dll, with exception code 0xc0000005.

I found out that this works fine:

int ulonghandle_print(RtiULongHandleObject *v, FILE *fp, int flags)
{
    fputc('c', stdout);
    return 0;
}

But this causes the error:

int ulonghandle_print(RtiULongHandleObject *v, FILE *fp, int flags)
{
    fputc('c', fp);  // <-- "fp" instead of "stdout"
    return 0;
}

It occurs under Windows (XP SP2) only. Under Linux everything works
fine.


Do you have any idea what could be wrong?

Thanks,
Petr



More information about the Python-list mailing list