odoo/bin/osv
Olivier Dony bb82904ba3 [FIX] fields.function: make sure all binary values can always be serialized as valid XML
Nnormally, binary fields should be 7-bit ASCII base64-encoded data, but sometimes
it's not the case, so we do additional sanity checks to make sure the binary values
can pass safely via xmlrpc as strings.

As a last resort we coerce the binary values to unicode to make sure they can
be safely serialized as utf-8-encoded values, always valid XML characters.
When this happens, decoding on the other endpoint is not likely to produce
the expected output, but this isjust a safety mechanism(in these cases base64
data or xmlrpc. Binary values should be returned instead by the function field.

In a future version we should probably switch to using XMLRPC Binary types always for
passing fields.binary values, but this requires more refactoring.

lp bug: https://launchpad.net/bugs/670778 fixed

bzr revid: odo@openerp.com-20101209230742-gwf8e4zvmk43k6ln
2010-12-10 00:07:42 +01:00
..
__init__.py Changed encoding to coding ref: PEP: 0263 2009-10-20 16:22:23 +05:30
expression.py expression: fix "m2o, m2m in []" expressions, bug 626806 2010-11-29 20:34:13 +02:00
fields.py [FIX] fields.function: make sure all binary values can always be serialized as valid XML 2010-12-10 00:07:42 +01:00
orm.py [IMP] orm,base: added context to _constraints functions + use generic osv.osv.check_recursion() 2010-12-09 11:57:33 +01:00
osv.py [FIX] osv.osv: code cleanup after merging previous patches 2010-11-24 17:40:41 +01:00
query.py [IMP] osv.query,orm: removed trailing whitespace introduced by previous commits 2010-10-01 18:54:11 +02:00