#12451 closed defect (fixed)
Error reports are not directed to trac-hacks.org if home_page or url attribute starts with https
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.8 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fixed error reports not sent to trac-hacks.org if |
||
API Changes: | |||
Internal Changes: |
Description
The issue is due to use of startswith
to compare against the string http://trac-hacks.org
: tags/trac-0.12.7/trac/web/main.py@:586,612#L578.
Proposed change:
-
trac/web/main.py
diff --git a/trac/web/main.py b/trac/web/main.py index ee7b0bb..9808ecf 100644
a b from pprint import pformat, pprint 31 31 import re 32 32 import sys 33 33 import traceback 34 from urlparse import urlparse 34 35 35 36 from genshi.builder import tag 36 37 from genshi.output import DocType … … def send_internal_error(env, req, exc_info): 670 671 faulty_plugins.sort(key=lambda p: p['frame_idx']) 671 672 if faulty_plugins: 672 673 info = faulty_plugins[0]['info'] 674 home_page = info.get('home_page', '') 673 675 if 'trac' in info: 674 676 tracker = info['trac'] 675 elif info.get('home_page', '').startswith(th):677 elif urlparse(home_page).netloc == urlparse(th).netloc: 676 678 tracker = th 677 679 plugin_name = info.get('home_page', '').rstrip('/') \ 678 680 .split('/')[-1]
Patch was created against the trunk. I will need to test it for 1.0-stable and 0.12-stable.
Attachments (0)
Change History (2)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed to 0.12-stable in [14717,14718], merged to 1.0-stable in [14719], merged to trunk in [14720].
CI tests will fail on 0.12 branch unless we pin the Pygments version. See #12083.
In [14717],
.netloc
attribute is available since Python 2.6. For 1.0-stable and 0.12-stable, we should useurlparse(home_page)[1]
instead.