Unable to read() from gridfs with python in Windows

[亡魂溺海] 提交于 2019-12-11 18:04:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!