• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aio-libs / aiohttp_debugtoolbar / 125 / 6
86%
master: 86%

Build:
DEFAULT BRANCH: master
Ran 27 Sep 2015 12:31PM UTC
Files 21
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Sep 2015 12:29PM UTC coverage: 86.067% (+0.01%) from 86.057%
PYTHONASYNCIODEBUG=0

Pull #24

travis-ci

massimiliano-della-rovere
Update utils.py

The HTTPNotModified exception of aiohttp correctly [1] does not set the location attribute in the response.

This causes an AttributeError in aiohttp_debugtoolbar/middlewares.py, at line "if response.status in REDIRECT_CODES and response.location:".

The proposed solution is removing the 304 code from the following line in the utils.py file and using the HTTP codes constants [2], i.e. from: 

REDIRECT_CODES = (301, 302, 303, 304)

to:

from http.client import (
    MOVED_PERMANENTLY,  # 301
    FOUND,  # 302
    SEE_OTHER)  # 303
REDIRECT_CODES = (MOVED_PERMANENTLY, FOUND, SEE_OTHER)

I'm against a change like the following one in middlewares.py, from
"if response.status in REDIRECT_CODES and response.location:"
into
"if response.status in REDIRECT_CODES and getattr(response, 'location', None):"
because http.client.NOT_MODIFIED (304) responses do not make provision for a "Location" Response header.



[1] http://www.w3.org/Protocols/HTTP/HTRESP.html
[2] https://docs.python.org/3.5/library/http.html#http-status-codes
Pull Request #24: Update utils.py

1149 of 1335 relevant lines covered (86.07%)

0.86 hits per line

Source Files on job 125.6 (PYTHONASYNCIODEBUG=0)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 125
  • Travis Job 125.6
  • 21d54570 on github
  • Prev Job for PYTHONASYNCIODEBUG=0 on master (#124.6)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc