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

aio-libs / aiohttp_debugtoolbar / 125
86%

Build:
DEFAULT BRANCH: master
Ran 27 Sep 2015 12:30PM UTC
Jobs 6
Files 21
Run time 48s
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

pending completion
125

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%)

5.16 hits per line

Jobs
ID Job ID Ran Files Coverage
1 125.1 (PYTHONASYNCIODEBUG=1) 27 Sep 2015 12:30PM UTC 0
86.07
Travis Job 125.1
2 125.2 (PYTHONASYNCIODEBUG=0) 27 Sep 2015 12:30PM UTC 0
86.07
Travis Job 125.2
3 125.3 (PYTHONASYNCIODEBUG=1) 27 Sep 2015 12:30PM UTC 0
86.07
Travis Job 125.3
4 125.4 (PYTHONASYNCIODEBUG=0) 27 Sep 2015 12:30PM UTC 0
86.07
Travis Job 125.4
5 125.5 (PYTHONASYNCIODEBUG=1) 27 Sep 2015 12:30PM UTC 0
86.07
Travis Job 125.5
6 125.6 (PYTHONASYNCIODEBUG=0) 27 Sep 2015 12:31PM UTC 0
86.07
Travis Job 125.6
Source Files on build 125
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #125
  • Pull Request #24
  • PR Base - master (#124)
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