Modify

Opened 3 years ago

Last modified 7 months ago

#8688 new defect

Creating a ticket with the plugin enabled causes an error

Reported by: a.nehmer@… Owned by: rjollos
Priority: normal Component: TicketModifiedFilesPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by rjollos)

Error: AttributeError: 'NoneType' object has no attribute 'close'

StackTrace:

Datei "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", Zeile 511, in _dispatch_request
  dispatcher.dispatch(req)
Datei "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", Zeile 258, in dispatch
  content_type)
Datei "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/chrome.py", Zeile 840, in render_template
  stream |= self._filter_stream(req, method, filename, stream, data)
Datei "/usr/lib/python2.6/site-packages/Genshi-0.6-py2.6.egg/genshi/core.py", Zeile 132, in __or__
  return Stream(_ensure(function(self)), serializer=self.serializer)
Datei "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/chrome.py", Zeile 991, in inner
  data)
Datei "/usr/lib/python2.6/site-packages/TicketModifiedFiles-1.00-py2.6.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", Zeile 75, in filter_stream
  numconflictingtickets = self.__process_ticket_request(req, True)
Datei "/usr/lib/python2.6/site-packages/TicketModifiedFiles-1.00-py2.6.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", Zeile 194, in __process_ticket_request
  repos.close()

The error seems to occur due to an not specified default repository as self.env.get_repository() returns None

Attachments (3)

TicketModifiedFiles.png (16.0 KB) - added by anonymous 2 years ago.
ErrorWithChanges.txt (8.9 KB) - added by seribralcrow@… 2 years ago.
Python trace with new error
ManageRepositories.png (49.0 KB) - added by rjollos 2 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 follow-up: Changed 2 years ago by seribralcrow@…

I am having the same issue. Is anyone still actively working on the plugin?

comment:2 Changed 2 years ago by rjollos

  • Description modified (diff)
  • Trac Release changed from 0.11 to 0.12

comment:3 in reply to: ↑ 1 Changed 2 years ago by rjollos

  • Owner changed from e2jk to rjollos

Replying to seribralcrow@gmail.com:

I am having the same issue. Is anyone still actively working on the plugin?

Are you also running Trac 0.12? I suspect this is a Trac 0.12 issue that is due to changes in the API with the addition of multi-repository support.

comment:4 Changed 2 years ago by rjollos

I'm not able to reproduce. Do you have a default repository specified for your Trac installation?

comment:5 Changed 2 years ago by rjollos

The link to the list of modified files was not being injected below the Change History since the Genshi Transformer was not finding a match in Trac 0.12. In Trac 0.12, the div with id changelog is now wrapped in a div with no id. A fix that seems to work fine for both Trac 0.11 and Trac 0.12 is to match just the div with id changelog, rather than looking for a div with id changelog nested immediately below the div with id content.

comment:6 Changed 2 years ago by rjollos

(In [11457]) Refs #8688: Modified Genshi transformer so that it can find a match in Trac 0.12 and inject the modified files link below the Change History, as it does in Trac 0.11. This change should preserve the functionality in Trac 0.11.

Changed 2 years ago by anonymous

comment:7 Changed 2 years ago by anonymous

Following [11457], you should see something like this:


comment:8 Changed 2 years ago by anonymous

I am running trac 0.12. I do not have a default repo listed either. Is this an issue. I uploaded the new code and I am getting a new error.

AttributeError: 'NoneType' object has no attribute 'get_changeset'

I will attach a file that contains the python trace in it.

Changed 2 years ago by seribralcrow@…

Python trace with new error

Changed 2 years ago by rjollos

comment:9 Changed 2 years ago by rjollos

The multirepository feature is new to me, but I most recently set it up on my Trac installation following the instructions at t:TracRepositoryAdmin. It seems that the default repository can be specified in either trac.in or via the webadmin panel. Here is what the webadmin panel on my installation shows:


comment:10 follow-up: Changed 2 years ago by seribralcrow@…

Making my repo the default entry did fix this. I don’t think this is a bug but I will ask the question any way. When I did a resync after changing the repository the changesets are no longer associated with a given ticket. Is there a command I need to run to get them to re-associate?

comment:11 in reply to: ↑ 10 Changed 2 years ago by rjollos

Replying to seribralcrow@gmail.com:

Is there a command I need to run to get them to re-associate?

You might want to take a look at these steps, if you haven't read through them already: t:TracRepositoryAdmin#Migration. You may need to add an alias to the main repository.

comment:12 Changed 8 months ago by abrown

Will this plugin be modified to work with the latest versions of Trac that allow multiple repositories?

comment:13 Changed 7 months ago by rjollos

It's not very high on my priority list. I'd gladly take a patch though.

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.