Oleg Broytman wrote, On 07/08/2013 19:51:
> Hi!
> 
> On Wed, Aug 07, 2013 at 11:52:15AM +0200, Gert Burger <gertbur...@gmail.com> 
> wrote:
>> Attached is a test case demonstrating the issue. Tested with version
>> 1.5.0b1 and some previous versions.
> 
>    Thanks for the report!
> 
>> The EnumValidator checks if the value given is in the list of valid
>> enumValues but this allows unicode values to match normal string values.
>>
>> That allows unicode objects into the SQL generation code which forces
>> python to create unicode strings instead of normal strings. This means
>> already encoded values will be decoded again and probably with the wrong
>> encoding.
>>
>> My guess is that the EnumValidator should return only str objects that
>> are properly encoded.
> 
>    At the first glance I'm not sure what should be the correct behaviour
> for EnumValidator. I'll think about it.
> 
> Oleg.
> 

I'm also unsure hoe EnumValidator should react but I'm pretty sure that
one needs to either cater for unicode strings in final SQL generation or
prevent them from reaching that stage and I assume the Validators are
responsible for encoding.

The situation in Py3 will be different for sure.

-- 
Regards
Gert Burger

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to