﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27287	IndexError on broken pipe	Sjoerd Job Postmus	nobody	"In `WSGIServer.handle_error`, on a broken pipe, it calls `logger.info` with 2 arguments: a format and an address.

This uses the `ServerFormatter`, which expects either 0 or >= 2 args.

{{{
Traceback (most recent call last):
  File ""/usr/lib/python2.7/logging/__init__.py"", line 851, in emit
    msg = self.format(record)
  File ""/usr/lib/python2.7/logging/__init__.py"", line 724, in format
    return fmt.format(record)
  File ""/.../django/utils/log.py"", line 173, in format
    if args[1][0] == '2':
IndexError: tuple index out of range
Logged from file basehttp.py, line 85
}}}

I think a good fix might be to make it check against `len(args) < 2` instead of `len(args) == 0`.

While the code is being touched, it might also be a good idea to write `status_code = args[1]`, and use that in the `if`-chain."	Bug	new	Uncategorized	1.10	Normal				Unreviewed	0	0	0	0	0	0
