stacklevel for SAWarning about Unicode types

Issue #2707 new
Domen Kožar created an issue

When passing strings to a Unicode type, sqlalchemy complains: lib/python2.7/site-packages/SQLAlchemy-0.8.0-py2.7-linux-x86_64.egg/sqlalchemy/engine/default.py:455: SAWarning: Unicode type received non-unicode bind param value.

Those warnings are hard to debug. Changing stacklevel to 17 reports the stack correctly, but I'm not sure if stacklevel is dynamic.

Comments (4)

  1. Mike Bayer repo owner

    im not sure what the magic is for these stacklevels, we've had to change them a lot. Any suggestions ?

  2. Domen Kožar reporter

    Since it's 17 stacks, it probably changes quickly and there might be multiple paths to get to that warning. No idea how to do that dynamically, Googling doesn't reveal much.

  3. Log in to comment