[Qgis-developer] Qgis under windows: problems with python and sqlalchemy: bad file descriptor

Martin Dobias wonder.sk at gmail.com
Tue Mar 23 08:35:32 EDT 2010


On Mon, Mar 22, 2010 at 11:20 PM, Luca Mandolesi <mandoluca at gmail.com> wrote:
>
> Hi to alls,
> I've somes problems to make running my pyarchinit plugin under windows.
> Pyarchinit use sqlalchemy and under mac os x and Linux, all run properly.
> It's possible make using the python installed under windows and not the embedded into Qgis, or put sqlalchemy as psycopg2 into the distribution?
> If I lauch my functions directly from the IDLE, all run properly. But with the OsGeo and the standalone qgis I receive the error.
> I've asked to python programmers, and all tell me that the problem may be the python embedded into qgis.

Hi Luca

I had a very similar problem with PostGIS manager plugin on windows
when creating new processes using Popen. While it works in command
line python, it doesn't work within QGIS. The problem is obviously due
different (incompatible) C runtime libraries from different compilers.
So the file descriptors produced by C runtime library linked to QGIS
are not recognized in C runtime library used by Python.

I solved the problem by introducing some windows-specific workarounds,
not sure what you can do. A solution would be IMHO to compile QGIS
with the same compiler as the one used for compiling python -or-
recompiling python for osgeo4w (but that would probably have some
impact to additional python modules, too).

Regards
Martin


More information about the Qgis-developer mailing list