Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11736 closed defect (cantfix)

Old template causes TypeError: 'Milestone' object does not support indexing

Reported by: anonymous Owned by:
Priority: normal Milestone:
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

My Trac .egg file contained two templates:

because both were still in build/lib/ from earlier builds.

This lead to a TypeError: 'Milestone' object does not support indexing (names ('milestone', 'ticket_count')) while doing a GET operation on /admin/ticket/milestones:

File "build/bdist.win32/egg/trac/web/main.py", line 543, in _dispatch_request
    dispatcher.dispatch(req)
File "build/bdist.win32/egg/trac/web/main.py", line 243, in dispatch
    method=method)
File "build/bdist.win32/egg/trac/web/chrome.py", line 1067, in render_template
    encoding='utf-8')
File "build/bdist.win32/egg/genshi/core.py", line 183, in render
    return encode(generator, method=method, encoding=encoding, out=out)
File "build/bdist.win32/egg/genshi/output.py", line 58, in encode
    for chunk in iterator:
File "build/bdist.win32/egg/genshi/output.py", line 339, in __call__
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/output.py", line 826, in __call__
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/output.py", line 670, in __call__
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/output.py", line 771, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
File "build/bdist.win32/egg/genshi/output.py", line 586, in __call__
    for ev in stream:
File "build/bdist.win32/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
File "build/bdist.win32/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
File "build/bdist.win32/egg/trac/web/chrome.py", line 1215, in _strip_accesskeys
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
File "build/bdist.win32/egg/trac/web/chrome.py", line 1204, in _generate
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/template/base.py", line 605, in _include
    for event in stream:
File "build/bdist.win32/egg/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
File "build/bdist.win32/egg/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
File "build/bdist.win32/egg/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
File "build/bdist.win32/egg/genshi/template/markup.py", line 327, in _match
    for event in stream:
File "build/bdist.win32/egg/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
File "build/bdist.win32/egg/genshi/path.py", line 588, in _generate
    subevent = next()
File "build/bdist.win32/egg/genshi/template/base.py", line 605, in _include
    for event in stream:
File "build/bdist.win32/egg/genshi/template/markup.py", line 316, in _strip
    event = next()
File "build/bdist.win32/egg/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
File "build/bdist.win32/egg/genshi/path.py", line 588, in _generate
    subevent = next()
File "build/bdist.win32/egg/genshi/template/base.py", line 605, in _include
    for event in stream:
File "build/bdist.win32/egg/genshi/template/markup.py", line 316, in _strip
    event = next()
File "build/bdist.win32/egg/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
File "build/bdist.win32/egg/genshi/path.py", line 588, in _generate
    subevent = next()
File "build/bdist.win32/egg/genshi/template/base.py", line 605, in _include
    for event in stream:
File "build/bdist.win32/egg/genshi/template/markup.py", line 316, in _strip
    event = next()
File "build/bdist.win32/egg/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
File "build/bdist.win32/egg/genshi/template/directives.py", line 367, in __call__
    assign(scope, item)
File "build/bdist.win32/egg/genshi/template/directives.py", line 130, in _assign
    _assign(data, value[idx], names[idx])

Deleting the build folder and rebuilding the egg fixed the problem, so you might not consider this a defect per se; feel free to close this ticket. I just wanted to report it in case someone else has the same issue.

Attachments (0)

Change History (1)

comment:1 by Jun Omae, 10 years ago

Description: modified (diff)
Resolution: cantfix
Status: newclosed

Yeah, I think that is an InstallationIssue and not a defect. I consider that we should remove build directory before building source files, e.g. using setup.py clean --all, if the source files are changed.

Last edited 10 years ago by Jun Omae (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.