[Modeling-users] type('') and unicode
Status: Abandoned
Brought to you by:
sbigaret
|
From: Yannick G. <yan...@sa...> - 2003-07-16 15:08:38
|
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I stumbled upon some "if type(foo)=3D=3Dtype(''):" in the code=20
(grep -r -E "type\(''\)" .). This fail to match unicode that behave
like as string but is not the same type :
>>> type(u'') =3D=3D type('')
0
Is this some kind of obscure feature ?
This is used in the Qualifier code and it seems likely to me that
someone will eventually try to make a fetch with unicode. In fact I
might just try that right now...
UnicodeError: ASCII encoding error: ordinal not in range(128)
Argh !
there is "type(foo) in (type(''), type(u''))" or I could encode my
query or who knows what. Since some RDMS (aka MySQL) choke on
unicode, maybe it would be best to have every queries encoded in utf-8
but I prefer to have your opinion 1st.
=2D --=20
Yannick Gingras
Byte Gardener, Savoir-faire Linux inc.
(514) 276-5468
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/FWpurhy5Fqn/MRARAkmgAJ4n/Dvx9i/t560r20gUhYR5ZCO63wCgjEDN
Qf/VDsHVZu19gxfI3wq7Hgc=3D
=3DqKKk
=2D----END PGP SIGNATURE-----
|