I just did a fresh build of Python 3.3.3 on OSX, upgrading from 3.3.2, didn’t re-install psycopg2, and I’m able to connect via SQLAlchemy. So the issue might be local to windows.
On Nov 24, 2013, at 5:39 PM, Michael Bayer <[email protected]> wrote: > > On Nov 24, 2013, at 7:33 AM, Sibylle Koczian <[email protected]> wrote: > >> Hello, >> >> I'm using SQLAlchemy 0.8.3, psycopg2 2.5.1, Python 3.3.3 on Windows 7, >> PostgreSQL 9.3.1. No change to SQLAlchemy and psycopg2, update from Python >> 3.3.2 to 3.3.3 some days ago. > > the error is emitted by psycopg2 so I’d try a full reinstall of psycopg2 > first. SQLAlchemy uses various psycopg2 extensions and switches that may be > part of why a standalone test doesn’t produce a problem. Didn’t see anything > on the psycopg2 tracker. > > > > > >> >> Today I get this when trying to use this combination: >> >> >> Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit >> (AMD64)] on win32 >> Type "copyright", "credits" or "license()" for more information. >>>>> import sqlalchemy as sa >>>>> psystr = "postgresql+psycopg2://sib:mypassword@gespenst/sib" >>>>> psy_engine = sa.create_engine(psystr, echo=True) >>>>> psy_conn = psy_engine.connect() >> Traceback (most recent call last): >> File "C:\Python33\lib\site-packages\sqlalchemy\pool.py", line 768, in _do_get >> return self._pool.get(wait, self._timeout) >> sqlalchemy.util.queue.Empty >> >> During handling of the above exception, another exception occurred: >> >> Traceback (most recent call last): >> File "C:\Python33\lib\site-packages\sqlalchemy\engine\strategies.py", line >> 80, in connect >> return dialect.connect(*cargs, **cparams) >> File "C:\Python33\lib\site-packages\sqlalchemy\engine\default.py", line 285, >> in connect >> return self.dbapi.connect(*cargs, **cparams) >> File "C:\Python33\lib\site-packages\psycopg2\__init__.py", line 164, in >> connect >> conn = _connect(dsn, connection_factory=connection_factory, async=async) >> psycopg2.OperationalError >> >> The above exception was the direct cause of the following exception: >> >> Traceback (most recent call last): >> File "<pyshell#40>", line 1, in <module> >> psy_conn = psy_engine.connect() >> File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 1641, >> in connect >> return self._connection_cls(self, **kwargs) >> File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 59, in >> __init__ >> self.__connection = connection or engine.raw_connection() >> File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 1699, >> in raw_connection >> return self.pool.unique_connection() >> File "C:\Python33\lib\site-packages\sqlalchemy\pool.py", line 220, in >> unique_connection >> return _ConnectionFairy(self).checkout() >> File "C:\Python33\lib\site-packages\sqlalchemy\pool.py", line 431, in >> __init__ >> rec = self._connection_record = pool._do_get() >> File "C:\Python33\lib\site-packages\sqlalchemy\pool.py", line 788, in _do_get >> con = self._create_connection() >> File "C:\Python33\lib\site-packages\sqlalchemy\pool.py", line 225, in >> _create_connection >> return _ConnectionRecord(self) >> File "C:\Python33\lib\site-packages\sqlalchemy\pool.py", line 318, in >> __init__ >> self.connection = self.__connect() >> File "C:\Python33\lib\site-packages\sqlalchemy\pool.py", line 379, in >> __connect >> connection = self.__pool._creator() >> File "C:\Python33\lib\site-packages\sqlalchemy\engine\strategies.py", line >> 87, in connect >> ) from e >> sqlalchemy.exc.OperationalError: (OperationalError) None None >>>>> >> >> Using psycopg2 with Python 3.3.3, without SQLAlchemy in the mix, works as >> expected. >> >> Using pypostgresql instead of psycopg2 works as expected: >> >>>>> import sqlalchemy >>>>> pypgstr = "postgresql+pypostgresql://sib:mypassword@gespenst/sib" >>>>> pypg_engine = sqlalchemy.create_engine(pypgstr, echo=True) >>>>> pypg_conn = pypg_engine.connect() >> 2013-11-24 12:24:57,544 INFO sqlalchemy.engine.base.Engine select version() >> 2013-11-24 12:24:57,602 INFO sqlalchemy.engine.base.Engine {} >> 2013-11-24 12:24:57,610 INFO sqlalchemy.engine.base.Engine select >> current_schema() >> 2013-11-24 12:24:57,619 INFO sqlalchemy.engine.base.Engine {} >>>>> >> >> The problem is definitely new, I got it trying to run scripts I've certainly >> used without mishap a short time ago. I'm not sure what came last: updating >> Python or using SQLAlchemy with psycopg2 the last time. The last PostgreSQL >> update (from 9.2.x) came earlier. What can have happened and what should I >> do? >> >> Thank you for help, >> Sibylle >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sqlalchemy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/sqlalchemy. >> For more options, visit https://groups.google.com/groups/opt_out. >
signature.asc
Description: Message signed with OpenPGP using GPGMail
