My favorites | Sign in
Google
                
New issue | Search
for
| Advanced search | Search tips
Issue 430: to_xml Error with BlobProperty
4 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Nov 2008
Type-Defect
Priority-Medium
Log-1397924


Sign in to add a comment
 
Reported by sylvain.vivien, Jun 02, 2008
What steps will reproduce the problem?
1. create a model with a blob property
2. create a new object of this type
3. with this object : myobj.to_xml()

What is the expected output? What do you see instead?
expected : display the xml

i see an error :
Traceback (most recent call last):
  File "C:\Program
Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py",
line 501, in __call__
    handler.post(*groups)
  File "C:\Outils\eclipse\workspace\nopix\src\main.py", line 101, in post
    logging.info(imgt.to_xml())
  File "C:\Program
Files\Google\google_appengine\google\appengine\ext\db\__init__.py", line
718, in to_xml
    return entity.ToXml()
  File "C:\Program
Files\Google\google_appengine\google\appengine\api\datastore.py", line 403,
in ToXml
    xml += '\n  ' + '\n  '.join(self._PropertiesToXml(properties))
  File "C:\Program
Files\Google\google_appengine\google\appengine\api\datastore.py", line 433,
in _PropertiesToXml
    escaped_values = self._XmlEscapeValues(propname)
  File "C:\Program
Files\Google\google_appengine\google\appengine\api\datastore.py", line 464,
in _XmlEscapeValues
    xml.append(saxutils.escape(unicode(val)))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0:
ordinal not in range(128)


What version of the product are you using? On what operating system?
GAE 1.10 / Win XP sp2

Please provide any additional information below.

class Image(db.Model):
   pic = db.BlobProperty()

mypic = Image()
xml = mypic.to_xml() --> CRASH





 
Comment 1 by ma...@google.com, Sep 25, 2008
(No comment was entered for this change.)
Labels: Log-1397924
Comment 2 by ma...@google.com, Sep 25, 2008
(No comment was entered for this change.)
Status: Accepted
Comment 3 by billkatz, Nov 13, 2008
Ideally, there'd be an optional parameter to skip chosen properties with to_xml().  
Sometimes, we want to output XML for some entity properties without blobs and 
possibly text dumps tagging along.
Comment 4 by ma...@google.com, Nov 20, 2008
Blobproperties are now base64 encoded.
Status: Fixed
Sign in to add a comment