By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,907 Members | 1,932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,907 IT Pros & Developers. It's quick & easy.

fputs in tp_print crashes under Win32

P: n/a
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
Nov 12 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
En Wed, 12 Nov 2008 08:58:05 -0200, Petr Gotthard
<pe***********@centrum.czescribió:
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.
Short answer: compile your extension with the *same* compiler used to
compile Python itself: Visual Studio 2008 for 2.6, Visual Studio .NET 2003
for 2.5
For the long answer search http://wiki.python.org/moin/

--
Gabriel Genellina

Nov 15 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.