Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13359 closed defect (fixed)

UnboundLocalError is raised when changeset_modified is invoked for non-cached repository

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Component: TracBackLinkPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

Originally reported on gdiscussion:trac-users:nKTGxW5K78w.

$ trac-admin /path/to/tracenv
Welcome to trac-admin 1.0.15
Interactive Trac administration console.
Copyright (C) 2003-2013 Edgewall Software

Type:  '?' or 'help' for help on commands.

Trac [/path/to/tracenv]> changeset modified reponame 1234123412341234123412341234123412341234
17:51:36 Trac[api] WARNING: Exception caught while "changeset_modified"
Traceback (most recent call last):
  File "/venv/local/lib/python2.7/site-packages/tracbacklink/api.py", line 290, in _invoke
    return f(*args, **kwargs)
  File "/venv/local/lib/python2.7/site-packages/tracbacklink/api.py", line 381, in _changeset_modified
    self._resource_deleted('changeset', rev, 'repository',
UnboundLocalError: local variable 'rev' referenced before assignment

Attachments (1)

t13359.diff (14.9 KB) - added by Jun Omae 7 years ago.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by Jun Omae

Attachment: t13359.diff added

comment:1 Changed 7 years ago by Jun Omae

Status: newaccepted
Trac Release: 1.0

comment:2 Changed 7 years ago by roger.oberholtzer@…

I installed the latest version (tracbacklinkplugin-17023.zip) and restarted my Apache server. I see that the version of the plugin went from 1.0.5 to 1.0.8.

I checked in a changset and got this:

2018-01-22 13:33:37,009 Trac[api] WARNING: Exception caught while "changeset_modified"
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/tracbacklink/api.py", line 290, in _invoke
    return f(*args, **kwargs)
  File "build/bdist.linux-x86_64/egg/tracbacklink/api.py", line 381, in _changeset_modified
    self._resource_deleted('changeset', rev, 'repository',
UnboundLocalError: local variable 'rev' referenced before assignment

OOC, should the change have only been in tests/api.py? That is all that is changed in the downloaded zip file.

comment:3 Changed 7 years ago by Jun Omae

No. Please try latest with t13359.diff patch.

comment:4 Changed 7 years ago by roger.oberholtzer@…

I applied the patch to tracbacklinkplugin-17023.zip. And now the messages are no longer in the log. And the back links seem to still be working.

Thanks!

comment:5 Changed 7 years ago by Jun Omae

Resolution: fixed
Status: acceptedclosed

In 17027:

TracBackLinkPlugin/1.0.9: fix UnboundLocalError raised when changeset_modified is invoked for non-cached repository (closes #13359)

comment:6 Changed 7 years ago by Jun Omae

Thanks for the feedback. Applied the patch.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.