14
V2EX  ›  V2EX

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

  •  
  •   14 · Dec 28, 2014 · 2323 views
    This topic created in 4155 days ago, the information mentioned may be changed or developed.

    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啊

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1104 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 283ms · UTC 18:23 · PVG 02:23 · LAX 11:23 · JFK 14:23
    ♥ Do have faith in what you're doing.