Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

"Martin v. Löwis" martin at v.loewis.de
Tue Feb 7 17:44:32 EST 2006


Christoph Zwerschke wrote:
>> So here is another strategy: flush the stream before going
>> into postgres, then obtain the fileno() of the stream, and
>> fdopen it with postgres' iostreams library. That might also
>> be tricky to implement, but could work.
> 
> 
> I understand what you mean. But the Postgres dll provides no means to
> fdopen a new stream.

Right. So you must do so in the pygresql module. That means you have
to get hold of msvcrt.dll's (sic) fdopen implementation.

One way to do so would be through linking pygresql to msvcrt.dll,
instead of linking it to msvcr71.dll. That should be only done if
it is certain that there won't be any other resource sharing with
Python (no malloc, no locale, no stdio - see "some" mskb article
for the precise list of restrictions). I would expect that no
such resource sharing happens, but one would have to verify the code
to be certain.

The other option is to use GetProcAddress to obtain the address of
fdopen.

Regards,
Martin



More information about the Python-list mailing list