这是一个创建于 4312 天前的主题,其中的信息可能已经有所发展或是发生改变。
在本地运行的时候一切都好,但当我部署到server(Ubuntu 12.10)上时,每次上传头像保存都会发生下面的错误:
```
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/tornado/web.py", line 1042, in _execute
getattr(self, self.request.method.lower())(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/tornado/web.py", line 1809, in wrapper
return method(self, *args, **kwargs)
File "/srv/www/domain.com/handler/user.py", line 127, in post
avatar_96x96.save("./static/avatar/b_%s.png" % avatar_name, "PNG")
File "/usr/local/lib/python2.6/dist-packages/PIL/Image.py", line 1433, in save
fp = __builtin__.open(fp, "wb")
IOError: [Errno 2] No such file or directory: './static/avatar/b_861c16ed-ecf4-5f49-ac5b-7d1565adf2a8.png'
```
我也上网找了好多资料,貌似也没有什么解决方法,请问有什么解决办法没,谢谢
3 条回复 • 1970-01-01 08:00:00 +08:00
|
|
1
CoX 2013-01-20 19:17:03 +08:00
错误很明显呐 No such file or directory 还是用绝对路径吧,目前存放的路径是 handler/static/avatar/
|
|
|
2
yetone 2013-01-20 20:13:10 +08:00
用绝对路径
|