Opened 10 years ago
Closed 10 years ago
#12285 closed defect (fixed)
AttributeError: 'TracError' object has no attribute 'replace'
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.10 |
| Component: | timeline | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Fixed |
||
| API Changes: | |||
| Internal Changes: | |||
Description
[pid 23749 140573412329216] 2015-12-17 10:06:48,386 Trac[main] ERROR: Internal Server Error: <RequestWithSession "GET '/timeline?from=2008-12-03T10:14:17+01:00&precision=second'">, referrer None
Traceback (most recent call last):
File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/web/main.py", line 594, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/web/main.py", line 251, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/timeline/web_ui.py", line 118, in process_request
add_warning(req, e)
File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/web/chrome.py", line 198, in add_warning
msg = escape(msg, False)
File "/usr/local/virtualenv/src/trac-1.1dev/.eggs/Genshi-0.7-py2.7-linux-x86_64.egg/genshi/core.py", line 519, in escape
text = text.replace('&', '&') \
AttributeError: 'TracError' object has no attribute 'replace'
[pid 10365 140573412329216] 2015-12-17 11:31:40,131 Trac[main] ERROR: Internal Server Error: <RequestWithSession "GET '/timeline?from=2011-02-02T11:38:50+01:00&precision=second'">, referrer 'http://trac.edgewall.org/wiki/TranslationRu'
Traceback (most recent call last):
File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/web/main.py", line 594, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/web/main.py", line 251, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/timeline/web_ui.py", line 118, in process_request
add_warning(req, e)
File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/web/chrome.py", line 198, in add_warning
msg = escape(msg, False)
File "/usr/local/virtualenv/src/trac-1.1dev/.eggs/Genshi-0.7-py2.7-linux-x86_64.egg/genshi/core.py", line 519, in escape
text = text.replace('&', '&') \
AttributeError: 'TracError' object has no attribute 'replace'
Attachments (0)
Change History (6)
comment:2 by , 10 years ago
| Release Notes: | modified (diff) |
|---|
Proposed changes in log:rjollos.git:t12285_timeline_tracerror.
comment:3 by , 10 years ago
1 failure without Babel.
Package Version
------------------------------------------------------------------
Python : 2.7.3 (default, Dec 18 2014, 19:10:20)
[GCC 4.6.3]
Setuptools : 0.6
Genshi : 0.7
Babel : not installed
sqlite3 : 2.6.0
PySqlite : 2.6.3
MySQLdb : 1.2.5
Psycopg2 : 2.6 (dt dec pq3 ext)
SVN bindings : not installed
Mercurial : 3.4
Pygments : not installed
Textile : not installed
Pytz : not installed
ConfigObj : not installed
Docutils : not installed
Twill : 0.9
LXML : 3.4.4
coverage : 4.0a5
figleaf : not installed
Variables:
PATH=/home/jun66j5/venv/py27-1.0/bin::$PATH
PYTHONPATH=.::$PYTHONPATH
TRAC_TEST_DB_URI=
server-options= -p 8000 -r -e
External dependencies:
Git version: git version 1.7.9.5
python setup.py egg_info
running egg_info
writing requirements to Trac.egg-info/requires.txt
writing Trac.egg-info/PKG-INFO
writing top-level names to Trac.egg-info/top_level.txt
writing dependency_links to Trac.egg-info/dependency_links.txt
writing entry points to Trac.egg-info/entry_points.txt
reading manifest file 'Trac.egg-info/SOURCES.txt'
writing manifest file 'Trac.egg-info/SOURCES.txt'
python ./trac/test.py --skip-functional-tests
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
======================================================================
FAIL: test_invalid_date_format_add_warning (trac.timeline.tests.web_ui.TimelineModuleTestCase)
Warning is added when date format is invalid.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/run/shm/7a6e2fd898f45ef48e6606f787200f89be1e54b8/py27-sqlite/trac/timeline/tests/web_ui.py", line 131, in test_invalid_date_format_add_warning
u'instead.', req.chrome['warnings'])
AssertionError: u'"2011-02-02T11:38:50+01:00&precision=second" is an invalid date, or the date format is not known. Try "MMM d, y" or "YYYY-MM-DDThh:mm:ss\xb1hh:mm" instead.' not found in [<Markup u'"2011-02-02T11:38:50+01:00&precision=second" is an invalid date, or the date format is not known. Try "MM/dd/YY" or "YYYY-MM-DDThh:mm:ss\xb1hh:mm" instead.'>]
----------------------------------------------------------------------
Ran 1523 tests in 20.594s
FAILED (failures=1)
follow-up: 5 comment:4 by , 10 years ago
Thanks, fixed in [406a4bee/rjollos.git] and test case improved in [54e2b44b/rjollos.git].
I noticed an unrelated issue. It doesn't make sense to mix date and datetime formats in the message Try "MMM d, y" or "YYYY-MM-DDThh:mm:ss±hh:mm" instead. I attempted to address that in [4a28370b/rjollos.git]. A unit test is still needed.
comment:5 by , 10 years ago
Replying to rjollos:
I noticed an unrelated issue. It doesn't make sense to mix date and datetime formats in the message Try "MMM d, y" or "YYYY-MM-DDThh:mm:ss±hh:mm" instead. I attempted to address that in [4a28370b/rjollos.git]. A unit test is still needed.
⇒ #12295.
comment:6 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |



Related to #12007. Issue is only seen for Genshi without speedups. Is the following patch the best solution?:
trac/web/chrome.py
msg, False)msg, False)