问题
I use pylons framefork and store some images in the gridfs.
This code works perfect for MacOS and Linux servers
f = self._fs.get(ObjectId(image))
# In linux unicode u'image/jpg' raise error, thats why I use str() for content-type
response.headers['Content-type'] = str(f.content_type)
return f.read()
In Windows I get an error "Unable to read image". What the reason?
来源:https://stackoverflow.com/questions/9708288/unable-to-read-from-gridfs-with-python-in-windows