Edgewall Software

Opened 10 years ago

Closed 10 years ago

#11450 closed defect (fixed)

UnboundLocalError: local variable 'data' referenced before assignment — at Version 2

Reported by: anonymous Owned by: Jun Omae
Priority: normal Milestone: 1.0.2
Component: version control/changeset view Version: 1.0-stable
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fix regression from [11812] when the starting directory node iterates itself.

API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /changeset/latest/plugins/1.0/spam-filter, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'format': u'zip',
 'new': u'latest',
 'new_path': u'/plugins/1.0/spam-filter',
 'old_path': u'/'}

User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0

System Information

System information not available

Enabled Plugins

Plugin information not available

Python Traceback

Traceback (most recent call last):
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/Trac-1.1.2dev_r11819-py2.7.egg/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/Trac-1.1.2dev_r11819-py2.7.egg/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/Trac-1.1.2dev_r11819-py2.7.egg/trac/versioncontrol/web_ui/changeset.py", line 353, in process_request
    partial(self._zip_iter_nodes, req, repos, data))
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/Trac-1.1.2dev_r11819-py2.7.egg/trac/versioncontrol/web_ui/util.py", line 223, in render_zip
    zipfile.writestr(create_zipinfo(path, **kwargs), data)
UnboundLocalError: local variable 'data' referenced before assignment

Change History (2)

comment:1 by Jun Omae, 10 years ago

Component: generalversion control/changeset view
Milestone: 1.0.2
Owner: set to Jun Omae
Status: newassigned
Version: 1.0-stable

Good catch! The issue occurs after r11812.

comment:2 by Jun Omae, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [12453] and merged to trunk in [12454].

Note: See TracTickets for help on using tickets.