Hi to all,
I'm using  a software called qgis that under windows embed python, and
for this sw I wrote a simple plugin that insert and read data into
postgres through sqlalchemy.

Under mac os x, linux, and from the ide in windows all run properly,
but, If I launch a query inside qgis I recive a bad file descriptor,
but I don't understand how to catch the error and solve it. Any ideas
when this error is raised.

Thanks a lot for any suggestions!!

Luca

I post all the error report:

Traceback (most recent call last):
  File "C:/Documents and Settings/Administrator/.qgis//python/plugins
\pyarchinit\pyarchinit_Site_mainapp.py", line 217, in
on_pushButton_save_pressed
    test_insert = self.insert_new_rec()
  File "C:/Documents and Settings/Administrator/.qgis//python/plugins
\pyarchinit\pyarchinit_Site_mainapp.py", line 234, in insert_new_rec

    self.DB_MANAGER.max_num_id(self.TABLE_NAME, self.ID_TABLE)+1,
  File "C:/Documents and Settings/Administrator/.qgis//python/plugins
\pyarchinit\modules\db\pyarchinit_db_manager.py", line 262, in
max_num_id
    table = Table(self.id_table, self.metadata, autoload = True)
  File "c:\python25\Lib\site-packages\sqlalchemy\schema.py", line
108,
in __call__
    return type.__call__(self, name, metadata, *args, **kwargs)
  File "c:\python25\Lib\site-packages\sqlalchemy\schema.py", line
236,
in __init__
    _bind_or_error(metadata).reflecttable(self,
include_columns=include_columns)
  File "c:\python25\Lib\site-packages\sqlalchemy\engine\base.py",
line
1265, in reflecttable
    self.dialect.reflecttable(conn, table, include_columns)
  File "c:\python25\Lib\site-packages\sqlalchemy\databases
\postgres.py", line 638, in reflecttable
    c = connection.execute(t, table=table_oid)
  File "c:\python25\Lib\site-packages\sqlalchemy\engine\base.py",
line
824, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "c:\python25\Lib\site-packages\sqlalchemy\engine\base.py",
line
874, in _execute_clauseelement
    return self.__execute_context(context)
  File "c:\python25\Lib\site-packages\sqlalchemy\engine\base.py",
line
896, in __execute_context
    self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
  File "c:\python25\Lib\site-packages\sqlalchemy\engine\base.py",
line
946, in _cursor_execute
    self.engine.logger.info(repr(parameters))
  File "C:\OSGeo4W\apps\Python25\lib\logging\__init__.py", line 985,
in info
    apply(self._log, (INFO, msg, args), kwargs)
  File "C:\OSGeo4W\apps\Python25\lib\logging\__init__.py", line 1101,
in _log
    self.handle(record)
  File "C:\OSGeo4W\apps\Python25\lib\logging\__init__.py", line 1111,
in handle
    self.callHandlers(record)
  File "C:\OSGeo4W\apps\Python25\lib\logging\__init__.py", line 1148,
in callHandlers
    hdlr.handle(record)
  File "C:\OSGeo4W\apps\Python25\lib\logging\__init__.py", line 655,
in handle
    self.emit(record)
  File "C:\OSGeo4W\apps\Python25\lib\logging\__init__.py", line 757,
in emit
    self.handleError(record)
  File "C:\OSGeo4W\apps\Python25\lib\logging\__init__.py", line 706,
in handleError
    traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr)
  File "C:\OSGeo4W\apps\Python25\lib\traceback.py", line 128, in
print_exception
    print_tb(tb, limit, file)
  File "C:\OSGeo4W\apps\Python25\lib\traceback.py", line 70, in
print_tb
    '  File "%s", line %d, in %s' % (filename,lineno,name))
  File "C:\OSGeo4W\apps\Python25\lib\traceback.py", line 16, in
_print
    file.write(str+terminator)
IOError: [Errno 9] Bad file descriptor

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to