Hello,
I came across this errors when I was working with unicode mysql database.

My record would not get displayed and I would get:
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbf in position
261: unexpected code byte

I was referred to
http://www.sqlalchemy.org/docs/04/dbengine.html#dbengine_establishing

Encode the incoming data as Unicode, but when I tried to apply option
like convert_unicode I wasn't successful.

I just don't know where to put it?

Config file are created like this.

dev.cfg has

sqlalchemy.dburi="mysql://user:[EMAIL PROTECTED]:3306/dbname

I could use charset=utf8 but that doesn't fix my error, and charset is
an option for mysqldb not sqlalchemy
sqlalchemy.dburi="mysql://user:[EMAIL PROTECTED]:3306/dbname?charset=utf8"

charset=ascii fixed  the error but now I am limited to that character set.

then
assign_mapper happens

then my class, controllers.


Somewhere in between these items call create_engine('mysql://localhost/foo')
 Is it in mapper or some other sqlalchemy function?

How do I set option like:
convert_unicode=True  via sqlalchemy.dburi ???


Adding it to the end via ?convert_unicode=True does not work.

raise exceptions.DBAPIError("Connection failed", e)
sqlalchemy.exceptions.DBAPIError: (Connection failed) (TypeError)
'convert_unicode' is an invalid keyword argument for this function

Thanks,
Lucas

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to