[sqlalchemy] Unicode String Error on Insert

2015-03-03 Thread J.D.
Hi, I am getting the following error, when I try to execute code to insert a new row into one of my tables, and I've googled for answers and tried everything I could find online and nothing seems to resolve the issue. sqlalchemy.exc.ProgrammingError: (ProgrammingError) You must not use 8-bit

Re: [sqlalchemy] Unicode String Error on Insert

2015-03-03 Thread Michael Bayer
J.D. jd.cor...@pearson.com wrote: My solution didn't work. I was able to get my Portuguese data to load by decoding it in ISO-8859-1, but by decoding I lose all the special characters like tildes. So I still don't understand how to get the engine to accept my data properly. J.D.

[sqlalchemy] unicode SAWarning

2013-05-06 Thread Richard Gerd Kuesters
Hi, I'm just pulling this up because it's a little anoying. Everytime I start my application, this warning shows: *[...]/lib/python2.7/site-packages/sqlalchemy/engine/default.py:471: SAWarning: Unicode type received non-unicode bind param value.** ** processors[key](compiled_params[key])* I

Re: [sqlalchemy] unicode SAWarning

2013-05-06 Thread Michael Bayer
this happens when you do this: class SomeClass(Base): # ... some_col = Column(Unicode(50)) s = SomeClass(somestring='some value') and then when you commit s to the database, the bytestring is detected and the warning emitted. Note 'some value' is a Python bytestring, not a Unicode

Re: [sqlalchemy] unicode SAWarning

2013-05-06 Thread Richard Gerd Kuesters
Thanks Mike. I know I must use unicode, and, in a matter of fact, I do respect the first item of your list. That's why I asked here :) I'll try items 2 and 5 (which seems more appropriate, since my application runs only on Postgres). Best regards, Richard. On 05/06/2013 05:50 PM, Michael

Re: [sqlalchemy] Unicode warnings - show offending value

2013-01-10 Thread Felix Schwarz
Am 10.01.2013 00:45, schrieb Michael Bayer: Can't, because as a python warning, the warnings lib caches that message permanently, to support the typical case that the warnings filter is set to once. If the message were unique for every value your app would slowly leak memory I see, bad

Re: [sqlalchemy] Unicode warnings - show offending value

2013-01-10 Thread Bill Curtis
Felix, Another technique I have used, in case you are not aware of it: I add this: import traceback util.warn(str(traceback.format_stack())) to whichever sqlalchemy .py file is producing the error, right at the point where the error is emitted. Then whenever it happens, you get a full

[sqlalchemy] Unicode warnings - show offending value

2013-01-09 Thread Felix Schwarz
sometimes I get unicode warnings from SQLAlchemy (Unicode type received non-unicode bind param value). I find it very hard to fix these issues because I don't know where to look (often it's not a string literal explicitely in the code but some external library which returns a string instead

[sqlalchemy] unicode in where clause on mysql

2012-07-18 Thread Cornelius Kölbel
Hi there, I am trying to do a select on a table, where a user has a /username/ with a German umlaut like kölbel. The table in the mysql-database is utf-8. I also failed when the table was latin1. My problem is that by no(!) chance I manage to match the user and get a row from the select

Re: [sqlalchemy] unicode in where clause on mysql

2012-07-18 Thread Michael Bayer
easiest way here would be to specify use_unicode=1charset=utf8 with the MySQL connection string, so that your MySQLdb DBAPI handles incoming unicode objects correctly. http://docs.sqlalchemy.org/en/rel_0_7/dialects/mysql.html#unicode On Jul 18, 2012, at 7:45 AM, Cornelius Kölbel wrote: Hi

[sqlalchemy] unicode everywhere

2011-04-12 Thread Chris Withers
Hi All, I'm keen to avoid being bitten by annoying unicode decoding and encoding errors, particularly later during project development (you know, when the stuff that no longer fits into the encoding you accidentally used turns up once you think development is done and dusted ;-) ) What's

[sqlalchemy] Unicode problem with MySQL-Table with collation utf8_bin and utf8_general_ci

2010-12-09 Thread Marko Krause
Hello, I have a problem with sqlalchemy 5.8 and mysql 5.1. I have a table with a text-column, which has the collation utf8_general_ci. When I access the table sqlalchemy returns a Unicode, as it was expected. But when I change the collation of the column to utf8_bin, sqlalchemy returns an

Re: [sqlalchemy] Unicode problem with MySQL-Table with collation utf8_bin and utf8_general_ci

2010-12-09 Thread Michael Bayer
specify use_unicode=0 on your MySQL engine. SQLAlchemy will perform the utf-8 decode instead. On Dec 9, 2010, at 6:56 AM, Marko Krause wrote: Hello, I have a problem with sqlalchemy 5.8 and mysql 5.1. I have a table with a text-column, which has the collation utf8_general_ci. When I

[sqlalchemy] Unicode Results from SQL functions

2008-09-24 Thread Shawn Church
I am trying to construct a select query in mysql (version 5.0.51a-3ubuntu5.3-log) using SQL functions. Once I set the convert_unicode flag = True on my engine some function results are returned as type str and some results are returned as type unicode (I want, and expected, all unicode).

[sqlalchemy] Unicode not getting translated to SQL Server?

2008-08-29 Thread Mike
Hi, I have a weird issue wherein I send a unicode string to SQL Server 2000 using SqlAlchemy in a wxPython program. A little history would probably help: I created a timesheet program last year using wxPython and connected to my databases using pymssql. In the hopes of making this program more

[sqlalchemy] Unicode data into Binary type

2008-01-07 Thread Mike Bernson
Database is mysql I am having a problem with unicode and binary type. I am using an XML parse the return Unicode strings. I have a table in mysql with the default character set as utf8 I set the charset to utf8 in the connect string to charset=utf8 I am trying to send a unicode string to the

[sqlalchemy] unicode support for MSSQL

2007-10-30 Thread Florent Aide
Hi Mike, Hi all, Our conversation yesterday night on IRC gave me ideas :) I just added ticket #839 to the trac and attached a patch that enables unicode conversion for MSSQL dialects. I tested it with pyodbc but it should work the same with the other dialects. Best regards, Florent Aide.

[sqlalchemy] Unicode column cannot be fetched again after a un-unicode string was inserted

2007-05-21 Thread Jiang Sanyi
The column is set to Unicode,why SQLAlchemy still can save a un-unicode string, and now I cannot fetch this row. show_q_a_all() Traceback (most recent call last): File console, line 1, in ? File D:\Riverleaf-Python2.4package\RiverSMS\cli\question.py, line 6, in show _q_a_all qs =

[sqlalchemy] Unicode URL error

2007-03-30 Thread Andrew Stromnov
ascii-encoded string: url = 'mysql://login:[EMAIL PROTECTED]/adverts?charset=cp1251' engine = sqlalchemy.create_engine(url, convert_unicode=True, pool_recycle=4) metadata = sqlalchemy.BoundMetaData(engine) ad_table = sqlalchemy.Table('adverts', metadata, autoload=True) unicode string:

[sqlalchemy] unicode

2006-12-14 Thread jose
Hi all, I'm trying to insert UTF8 characters (like this: perchè) in PostgreSQL but... File build/bdist.linux-i686/egg/sqlalchemy/orm/attributes.py, line 589, in __init__ File build/bdist.linux-i686/egg/sqlalchemy/orm/attributes.py, line 51, in is_equal File