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
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: Unicode type 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.
> For more options, visit 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].
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