Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

"Martin v. Löwis" martin at v.loewis.de
Wed Feb 8 14:04:10 EST 2006


Christoph Zwerschke wrote:
> I think this would only shift the problem. Because then I would have to
> convert the msvcr71 stream I get from Python to a msvcrt stream. Using
> fileno() (of msvcrt) to get the file descriptor will probably not work.

It actually would:

#define _fileno(_stream)  ((_stream)->_file)

This definition is the same in all CRT version, plus the _file member
is at the same offset in all CRT versions. Microsoft apparently wants
to support linkage of object files build with one CRT version against
a different CRT version.

It *is* hacky, of course.

> But thanks a lot for your help. Sometimes you don't know whether you're
> doing something terribly wrong or missing a very easy solution if you
> don't discuss with others.

Right. I come more and more to the conclusion that you shouldn't really
be using the CRT on Win32.

Anyway, I just proposed to have Python 2.5 link against msvcrt.dll
on python-dev, and got mixed responses.

Regards,
Martin



More information about the Python-list mailing list