String validator returning unicode
Peter Russell <[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Organization | Qustom |
| Message-ID | <[email protected]> |
Hi, I'm not entirely sure if this is a bug, but the behaviour of the String validator seems odd to me. If its to_python method is passed a unicode object it returns a unicode object. This is a problem when using SQLObject, where if you try to pass unicode objects into StringCols (reasonably thinking they are strings, since they've been through a string validator), you get a unicode decode error. I think the sensible behaviour for String would be to convert to str. Is this sensible? -- Peter Russell <[email protected]> Qustom ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642