so this code runs fine on many machines, just one machine is doing this?   have 
there been modifications made to the SQLAlchemy library on that one machine?  
I’m not able to reproduce this case.   There’s a path where 
table.dialect_kwargs gets populated and within the scope of MySQL reflection, 
the keys are definitely strings.  I’ve tried with python 2.6 just in case it’s 
a 2.6 issue.

if the code works on all machines except one then you need to isolate what is 
different on that one machine.

In particular, if you ran this code:


try:
    BaseA.metadata.reflect(local_engine_a)
except:
    import pdb
    pdb.post_mortem()

assuming console script, this would drop you into a pdb session.  if you then 
type:

pdb > table.dialect_kwargs

it will show you the contents of the dictionary.  send me that.





On Feb 10, 2014, at 11:11 AM, robert rottermann <rob...@redcor.ch> wrote:

> Hi there,
> 
> I have a mysql database that I use on several linux boxes.
> No I get the following error on on of them:
> 
> Traceback (most recent call last):
>  File "../bin/zopepy", line 317, in <module>
>    execfile(__file__)
>  File "t.py", line 38, in <module>
>    BaseA.metadata.reflect(local_engine_a)
>  File 
> "/home/zope/key2go/eggs/SQLAlchemy-0.9.2-py2.6-linux-i686.egg/sqlalchemy/sql/schema.py",
>  line 3268, in reflect
>    Table(name, self, **reflect_opts)
>  File 
> "/home/zope/key2go/eggs/SQLAlchemy-0.9.2-py2.6-linux-i686.egg/sqlalchemy/sql/schema.py",
>  line 350, in __new__
>    table._init(name, metadata, *args, **kw)
>  File 
> "/home/zope/key2go/eggs/SQLAlchemy-0.9.2-py2.6-linux-i686.egg/sqlalchemy/sql/schema.py",
>  line 423, in _init
>    self._autoload(metadata, autoload_with, include_columns)
>  File 
> "/home/zope/key2go/eggs/SQLAlchemy-0.9.2-py2.6-linux-i686.egg/sqlalchemy/sql/schema.py",
>  line 435, in _autoload
>    self, include_columns, exclude_columns
>  File 
> "/home/zope/key2go/eggs/SQLAlchemy-0.9.2-py2.6-linux-i686.egg/sqlalchemy/engine/base.py",
>  line 1160, in run_callable
>    return callable_(self, *args, **kwargs)
>  File 
> "/home/zope/key2go/eggs/SQLAlchemy-0.9.2-py2.6-linux-i686.egg/sqlalchemy/engine/default.py",
>  line 345, in reflecttable
>    return insp.reflecttable(table, include_columns, exclude_columns)
>  File 
> "/home/zope/key2go/eggs/SQLAlchemy-0.9.2-py2.6-linux-i686.egg/sqlalchemy/engine/reflection.py",
>  line 463, in reflecttable
>    for col_d in self.get_columns(table_name, schema, **table.dialect_kwargs):
> TypeError: get_columns() keywords must be strings
> 
> 
> 
> this is the testscript I use to create the error:
> 
> 
> from sqlalchemy import create_engine
> from sqlalchemy.dialects import mysql
> 
> import sys
> 
> infoa = {
>    'username' : 'root',
>    'pw' : '',
>    'host' :'localhost',
>    'drivername' : 'mysql',
>    'database' : 'energie_2',
>    'extra_param' : ''
> }
> 
> LOCAL_DSN_A 
> ="%(drivername)s://%(username)s@%(host)s/%(database)s?charset=utf8%(extra_param)s"
>  % infoa
> 
> local_engine_a = create_engine(LOCAL_DSN_A)
> 
> BaseA.metadata.reflect(local_engine_a)
> 
> 
> thanks for your help
> and thanks for a wonderful library.
> 
> robert
> 
> -- 
> 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 sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to