he needs to supply data to the DB as python unicode objects..the  
strings from the file should be decoded first from ISO-8859.

if he wants to sqlite's "text_factory" feature, he can use a custom  
connection function described in 
http://www.sqlalchemy.org/docs/04/dbengine.html#dbengine_establishing_custom 
  .



On Dec 5, 2007, at 3:07 AM, Gaetan de Menten wrote:

>
> Anybody knows about this?
>
> ---------- Forwarded message ----------
> From: Mitch <[EMAIL PROTECTED]>
> Date: Dec 5, 2007 1:06 AM
> Subject: [elixir] sqlite3.OperationalError: Could not decode to  
> UTF-8 column
> To: SQLElixir <[EMAIL PROTECTED]>
>
> Apologies in advance if this should be sent to the SQLAlchemy list
> instead...
>
> I have an SQLite3 database created with SQLElixir.  One of the table
> columns, of type String, is being populated from a file which contains
> ISO-8859 data.  When I try to query all records from the table I get a
> traceback which ends with:
>
>  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/SQLAlchemy-0.4.1-py2.5.egg/sqlalchemy/engine/
> base.py", line 1497, in fetchall
>    l = [self._process_row(self, row) for row in
> self._fetchall_impl()]
>  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/SQLAlchemy-0.4.1-py2.5.egg/sqlalchemy/engine/
> base.py", line 1492, in _fetchall_impl
>    return self.cursor.fetchall()
> sqlite3.OperationalError: Could not decode to UTF-8 column '[...]'
> with text [...]
>
>
> If I were using the sqlite3 module directly, an acceptable workaround
> would be to override the default text factory for the database
> connection, e.g. "conn.text_factory = str".  Is there any way to do
> this via the elixir or sqlalchemy APIs?  Is there a better solution?
>
> Thanks for the help.
>
> -- 
> Gaƫtan de Menten
> http://openhex.org
>
> >


--~--~---------~--~----~------------~-------~--~----~
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