UnicodeDecodeError on Expando dynamic properties with Unicode chars
Closed this issue · 0 comments
GoogleCodeExporter commented
class MyModel(ndb.Expando):
pass
instance = MyModel(property=u'薇薇鄭')
instance.put()
In a template somewhere: {{ instance.property }}
This works fine on the SDK, but results in a UnicodeDecodeError in production.
The workaround is to declare the dynamic property:
class MyModel(ndb.Expando):
property = ndb.StringProperty()
...but that sorta defeats the purpose of using Expando. I've tried
decoding/encoding it with no luck. It ``just worked'' before I ported my app to
use ndb.
type(instance.property) returns <type 'str'> when the property is dynamic and
<type 'unicode'> when declared. Should it be <type 'unicode'> regardless?
Version: 1.0(?) bundled with App Engine 1.6.4.
Original issue reported on code.google.com by caseydwyer
on 29 Mar 2012 at 8:29