V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
14
V2EX  ›  V2EX

头像上传出错会直接返回 Traceback 信息

  •  
  •   14 · 2014-12-28 17:27:39 +08:00 · 1896 次点击
    这是一个创建于 3419 天前的主题,其中的信息可能已经有所发展或是发生改变。

    https://www.v2ex.com/settings/avatar

    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1332, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 2607, in wrapper
        return method(self, *args, **kwargs)
      File "/data/www/v2ex/galaxy/handlers/web/settings.py", line 535, in post
        avatar73 = self.rescale(avatar, 73, 73)
      File "/data/www/v2ex/galaxy/handlers/__init__.py", line 745, in rescale
        img = pil.open(input_file)
      File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 2288, in open
        % (filename if filename else fp))
    IOError: cannot identify image file <cStringIO.StringI object at 0x7f04f64179c0>
    

    原因是我上传了非图片格式。。。但是不应该返回Traceback啊

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1161 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:04 · PVG 03:04 · LAX 12:04 · JFK 15:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.