On 4/22/15 5:47 AM, Pavel S wrote:
If I turn warnings into errors, the problem is still the same:

1) where the error occured as the code path in traceback is not pointing to the place where select() has been bound with values
that would suggest your code has some less typical form where you are creating a select() object in some distant place, storing it, and then invoking it in some other place entirely? If so, you'd have to track that. Bound parameter values aren't touched until execution time.

Turning on SQL logging will illustrate the statement being sent and you can use some basic intuition to point it to what code is causing it.




2) you don't know what was the value





Dne středa 22. dubna 2015 10:09:51 UTC+2 SElsner napsal(a):

    Hey,

    you dan do:

      import warnings
      warnings.simplefilter('|error|')

    This will raise an exception. and give you a stacktrace on where
    the Unicode warnign happened.

    On 04/22/2015 09:48 AM, Pavel S wrote:
    Hi,

    it happened to me many times during development, mainly when used
    custom column types, that I passed wrong type of value to the query.

    Then the the following warning was emitted:|

    ||
    SAWarning: Unicodetype received non-unicode bindparam value
    |
    The problem with such warning is it does not say
    1) were the problem occurred (the line number points to somewhere
    in sqlalchemy and not to my application)
    2) what was the value which caused the problem ( repr() of that
    value would be nice to have)

    I always had to hack sqlalchemy/sql/sqltypes.py and add print
    value before the warning is emitted to actually see what was wrong.

    Is there any convenient way how to solve such issue?

-- You received this message because you are subscribed to the
    Google Groups "sqlalchemy" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected] <javascript:>.
    To post to this group, send email to [email protected]
    <javascript:>.
    Visit this group at http://groups.google.com/group/sqlalchemy
    <http://groups.google.com/group/sqlalchemy>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

--
    _*check out pointcloud9.com*_ <http://pointcloud9.com/>

    **Sebastian Elsner - Pipeline Techincal Director - RISE*

    t: +49 30 20180300 [email protected] _ <javascript:>
    f: +49 30 61651074 _www.risefx.com_ <http://www.risefx.com/>*

    *RISE FX GmbH*
    *Schlesische Strasse 28, 10997 Berlin
    An der Schanz 1A, 50735 Köln
    Büchsenstraße 20, 70174 Stuttgart
    Gumpendorferstrasse 55, 1060 Wien
    Geschaeftsfuehrer: Sven Pannicke, Robert Pinnow
    Handelsregister Berlin HRB 106667 B*

--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to