Re: Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-08 Thread Christoph Zwerschke
Martin v. Löwis wrote: > 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:

Re: Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-08 Thread Ross Ridge
Martin v. Löwis wrote: > In general, the only Microsoft-supported strategy is that you > must use only a single msvcrt in the entire application. So > either recompile PostGres, or recompile Python. If you want a compiled version of Python that already uses MSVCRT then you try using pyMingGW:

Re: Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-08 Thread Martin v. Löwis
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) ((_s

Re: Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-08 Thread Christoph Zwerschke
Martin v. Löwis wrote: > Christoph Zwerschke wrote: >> 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 d

Re: Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-07 Thread Martin v. Löwis
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 th

Re: Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-07 Thread Christoph Zwerschke
Martin v. Löwis wrote: > In general, the only Microsoft-supported strategy is that you > must use only a single msvcrt in the entire application. So > either recompile PostGres, or recompile Python. Hm, that's really inconvenient (even more so under Windows). > In the specific case, having PQprin

Re: Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-07 Thread Martin v. Löwis
Christoph Zwerschke wrote: > Is there a general strategy to avoid this kind of problems? In general, the only Microsoft-supported strategy is that you must use only a single msvcrt in the entire application. So either recompile PostGres, or recompile Python. In the specific case, having PQprint p

Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-07 Thread Christoph Zwerschke
The latest Windows distribution of Python 2.4.2 is using the msvcrt71.dll, while PostgreSQL is using msvcrt.dll. This lead to the following problem: I was using PyGreSQL to connect to the PostgreSQL database. There is a function that prints a query object q simply by writing: "print q". What h