how to prevent the "extended call syntax" (*) from expanding a string into a list of characters

fulv fulviocasali at gmail.com
Thu Jul 22 02:26:35 EDT 2010


I get the following error:

  File "<stdin>", line 1, in ?
  File "/Users/fulvio/plone/seiu_new/buildout/eggs/z3c.saconfig-0.11-
py2.4.egg/z3c/saconfig/utility.py", line 164, in __call__
    _ENGINES[self._key] = engine = sqlalchemy.create_engine(
  File "/Users/fulvio/plone/seiu_new/buildout/eggs/SQLAlchemy-0.6.3-
py2.4.egg/sqlalchemy/engine/__init__.py", line 244, in create_engine
    return strategy.create(*args, **kwargs)
TypeError: create() takes exactly 2 non-keyword arguments (150 given)

Basically, args and kwargs come as the return values from my
overridden function configuration():

                args, kw = self.configuration()
                _ENGINES[self._key] = engine =
sqlalchemy.create_engine(
                    *args, **kw)


This is what I'm returning from configuration():

        args = (connection_string)
        kwargs = {'echo' : True, 'encoding' : 'cp1252'}
        return args, kwargs

In other words, args is a list containing just one string.  It seems
to me that create_engine is interpreting that as a list of 150
characters.

Any suggestions, on what I'm doing wrong?

Thanks!
Fulvio



More information about the Python-list mailing list