On Sat, Nov 7, 2009 at 11:58 AM, Michael Bayer <mike...@zzzcomputing.com> wrote:
>
> On Nov 7, 2009, at 12:53 PM, Jon Nelson wrote:
>
> have you asked about this on the psycopg2 mailing list ?   its at
> http://mail.python.org/mailman/listinfo/python-list
>
>  .   Let me know if you do, because I'll get out the popcorn... :)
>
> That's the python list.
>
> oops:
> http://lists.initd.org/mailman/listinfo/psycopg
>
>
> I tried pg8000 but I got an error:
>
> ...
>
>    return self.dbapi.connect(*cargs, **cparams)
> sqlalchemy.exc.DBAPIError: (TypeError) connect() takes at least 1
> non-keyword argument (0 given) None None
>
> i can't reproduce that.   this is with the latest trunk:
> from sqlalchemy import *
> e = create_engine('postgresql+pg8000://scott:ti...@localhost/test')
> print e.execute("select 1").fetchall()
> produces:
> [(1,)]

Apparently, pg8000 requires host, user and pass (or at least one of those).

Of course, then when I am connected, I get a traceback:

...
    metadata.drop_all()
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/schema.py", line
1871, in drop_all
    bind.drop(self, checkfirst=checkfirst, tables=tables)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1336, in drop
    self._run_visitor(ddl.SchemaDropper, entity,
connection=connection, **kwargs)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1360, in _run_visitor
    visitorcallable(self.dialect, conn, **kwargs).traverse(element)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/visitors.py",
line 86, in traverse
    return traverse(obj, self.__traverse_options__, self._visitor_dict)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/visitors.py",
line 197, in traverse
    return traverse_using(iterate(obj, opts), obj, visitors)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/visitors.py",
line 191, in traverse_using
    meth(target)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/ddl.py",
line 89, in visit_metadata
    collection = [t for t in reversed(sql_util.sort_tables(tables)) if
self._can_drop(t)]
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/ddl.py",
line 104, in _can_drop
    return not self.checkfirst or
self.dialect.has_table(self.connection, table.name,
schema=table.schema)
  File 
"/usr/lib64/python2.6/site-packages/sqlalchemy/dialects/postgresql/base.py",
line 611, in has_table
    type_=sqltypes.Unicode)]
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py",
line 991, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1053, in _execute_clauseelement
    return self.__execute_context(context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1076, in __execute_context
    self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1136, in _cursor_execute
    self.dialect.do_execute(cursor, statement, parameters, context=context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py",
line 207, in do_execute
    cursor.execute(statement, parameters)
  File "pg8000/dbapi.py", line 243, in _fn
    return fn(self, *args, **kwargs)
  File "pg8000/dbapi.py", line 312, in execute
    self._execute(operation, args)
  File "pg8000/dbapi.py", line 317, in _execute
    self.cursor.execute(new_query, *new_args)
  File "pg8000/interface.py", line 303, in execute
    self._stmt = PreparedStatement(self.connection, query,
statement_name="", *[{"type": type(x), "value": x} for x in args])
  File "pg8000/interface.py", line 108, in __init__
    self._parse_row_desc = self.c.parse(self._statement_name, statement, types)
  File "pg8000/protocol.py", line 918, in _fn
    return fn(self, *args, **kwargs)
  File "pg8000/protocol.py", line 1069, in parse
    self._send(Parse(statement, qs, param_types))
  File "pg8000/protocol.py", line 975, in _send
    data = msg.serialize()
  File "pg8000/protocol.py", line 121, in serialize
    val = struct.pack("!i", len(val) + 4) + val
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8d in position
3: ordinal not in range(128)



-- 
Jon

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

Reply via email to