[sqlalchemy] Possible bug in MySQLDialect._check_unicode_returns() (missing optional parameter) (0.9.3 )

2014-02-21 Thread Oliver Bestwalter
Hi all, after updgrading sqlalchemy from 0.9.1 to 0.93 we (not always but often) get this traceback Traceback (most recent call last): File /opt/prodenv/trunk/frontend/decorators.py, line 134, in _decorated return func(*args, **kwargs) File /opt/prodenv/trunk/frontend/buildmgt_frontend.py,

Re: [sqlalchemy] Possible bug in MySQLDialect._check_unicode_returns() (missing optional parameter) (0.9.3 )

2014-02-21 Thread Michael Bayer
On Feb 21, 2014, at 7:05 AM, Oliver Bestwalter oliver.bestwal...@avira.com wrote: File /usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py, line 166, in first_connect dialect.initialize(c) File /usr/local/lib/python2.7/dist-packages/sqlalchemy/dialects/mysql/base.py,

Re: [sqlalchemy] Possible bug in MySQLDialect._check_unicode_returns() (missing optional parameter) (0.9.3 )

2014-02-21 Thread Oliver Bestwalter
Hi Michael, Am Freitag, 21. Februar 2014 13:24:05 UTC+1 schrieb Michael Bayer: On Feb 21, 2014, at 7:05 AM, Oliver Bestwalter oliver.b...@avira.comjavascript: wrote: File /usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py, line 166, in first_connect

Re: [sqlalchemy] Possible bug in MySQLDialect._check_unicode_returns() (missing optional parameter) (0.9.3 )

2014-02-21 Thread Jonathan Vanasco
I'd suggest recompiling mysqldb I've had weird/odd issues happen when either Python or MySQL/PostgreSQL were updated and the driver wasn't. Even for minor updates ( Python 2.7.4 - 2.7.5 ; Postgres 9.3 - 9.4, etc ), the compiled c-extension will often cause random errors if anything that

[sqlalchemy] event listening on query

2014-02-21 Thread Tino Dai
Hi All, I having some problems with having the event listen fire when I'm setting the attributes via a query. Base = declarative_base() lisDb = create_engine(Schema.lisDbstring()) Base.metadata = MetaData(bind=lisDb, schema=Schema.lisSchema()) lisSession = sessionmaker(lisDb) easternTz

[sqlalchemy] unable to add unicode characters such as ('軟件開發人員') to mysql database using sqlalchemy

2014-02-21 Thread Kin
Hello. i am not being able to write those traditional chinese characters to my mysql database. From my understanding of the link below: http://docs.sqlalchemy.org/en/rel_0_9/dialects/mysql.html I should have been able to write unicode characters to my mysql database, and be able to read them

Re: [sqlalchemy] unable to add unicode characters such as ('軟件開發人員') to mysql database using sqlalchemy

2014-02-21 Thread Michael Bayer
On Feb 21, 2014, at 2:42 PM, Kin kinrac...@gmail.com wrote: Hello. i am not being able to write those traditional chinese characters to my mysql database. From my understanding of the link below: http://docs.sqlalchemy.org/en/rel_0_9/dialects/mysql.html I should have been able to

Re: [sqlalchemy] event listening on query

2014-02-21 Thread Tino Dai
attribute events are listening specifically for changes made to an object in within the user application, which is not the same as the object being loaded from the database. To establish a listener that intercepts when an object is loaded, you can use the load event:

[sqlalchemy] Re: unable to add unicode characters such as ('軟件開發人員') to mysql database using sqlalchemy

2014-02-21 Thread Kin
The python version is: 2.7.3 And while attempting to commit my change, this is the error message I obtained: *UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-5: ordinal not in range(256)* I actually did obtain that a couple of time while trying to send a unicode

Re: [sqlalchemy] unable to add unicode characters such as ('軟件開發人員') to mysql database using sqlalchemy

2014-02-21 Thread Michael Bayer
try the script I gave you, start with that. On Feb 21, 2014, at 5:17 PM, Kin kinrac...@gmail.com wrote: The python version is: 2.7.3 And while attempting to commit my change, this is the error message I obtained: UnicodeEncodeError: 'latin-1' codec can't encode characters in position

[sqlalchemy] recommendation sought - implementing custom column type

2014-02-21 Thread Jonathan Vanasco
i currently have a table that looks like this: class MyTable(DeclaredTable): id = sa.Column(sa.Integer, primary_key=True) features_enabled = sa.Column(sa.Integer, nullable=False, default=0, ) _feature_manager = None @property def

Re: [sqlalchemy] unable to add unicode characters such as ('軟件開發人員') to mysql database using sqlalchemy

2014-02-21 Thread Kin Rachid KONE KITO
I did. It is your script that gave me the error. i had to correct *object1 = Writers3(u'軟件開發人員’)* (as it gave me a syntax error due to the closing quote), then set the right Ips. The error I obtained come from that modified script. -- You received this message because you are subscribed to the

Re: [sqlalchemy] Possible bug in MySQLDialect._check_unicode_returns() (missing optional parameter) (0.9.3 )

2014-02-21 Thread Oliver Bestwalter
Hi Jonathan, thanks, I'll do that from now on. Cheers Oliver On 21 February 2014 19:16, Jonathan Vanasco jonat...@findmeon.com wrote: I'd suggest recompiling mysqldb I've had weird/odd issues happen when either Python or MySQL/PostgreSQL were updated and the driver wasn't. Even for minor

Re: [sqlalchemy] recommendation sought - implementing custom column type

2014-02-21 Thread Michael Bayer
On Feb 21, 2014, at 5:48 PM, Jonathan Vanasco jonat...@findmeon.com wrote: i currently have a table that looks like this: class MyTable(DeclaredTable): id = sa.Column(sa.Integer, primary_key=True) features_enabled = sa.Column(sa.Integer, nullable=False, default=0, )