The proxy processing code placed the raw IPAddress object into the bark.useragent_ip key of the WSGI environment, instead of converting it to a string. This could not be discovered in the unit test, since proxy._parse_ip() was mocked out.
Turns out handlers.py imports middleware.py, which causes an import loop when nose imports test_middleware.py all by itself. Eliminate the import loop by using wrap_log_handler() instead of BarkMiddleware.__call__(). (This is less than ideal, but the log record fields we're trying to fill don't really make sense anyway.)