Bug#394999: [Python-modules-team] Bug#394999: python-mysqldb: Str2Set conversion broken

Ulrich P. Klein klein at ulrich-p-klein.de
Wed Nov 1 07:08:25 CET 2006


Hello Jonas,
> The debian package patches the Str2Set function:
>
> --- python-mysqldb-1.2.1-p2/MySQLdb/converters.py
> +++ python-mysqldb-1.2.1-p2/MySQLdb/converters.py
> @@ -42,7 +42,8 @@
>  def Bool2Str(s, d): return str(int(s))
>
>  def Str2Set(s):
> -    return Set([ i for i in s.split(',') if i ])
> +    values = s.split(',')
> +    return apply(str, tuple(values))
>
>  def Set2Str(s, d):
>      return string_literal(','.join(s), d)
>
> The packages at http://people.debian.org/~mejo/python-mysqldb/ don't
> have this patch applied.
>
> I'm happy to use your patch, but i'm just interested whether the
> original upstream fails for you too.
>   
I relized that my "patch" makes the Set2Str fail (an thus wouldn't be a
good idea). Removing the Debian patch to Str2Set an rebuilding the .deb
works fine.

I tried to understand the discussion about this particular patch but I
still cannot see how it could work when str contains a comma.

Thanks for your help!
Uli <><





More information about the Python-modules-team mailing list