GAE open()

alex goretoy aleksandr.goretoy at gmail.com
Mon Feb 9 01:48:27 EST 2009


Hello,

How to open binary file for writing into datastore. I'm trying to loop over
listdir output of images directory, How to do this without using

self.request.POST.get.file.read(), or rather how to loop this task in app
engine

file(os.curdir+"somefile").read()

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position
14: ordinal not in range(128)

but when I try to read binary with b, I get IOError.


    raise IOError('invalid mode: %s' % mode)
IOError: invalid mode: b

-Alex Goretoy
http://www.alexgoretoy.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090209/b31bc150/attachment.html>


More information about the Python-list mailing list