'NoneType' object has no attribute 'b'

Asked by Martin Collins on 2010-04-03

I hesitate to log this as a bug as trac-bzr is not working at all for me but seems to for other people.
I have tried on Ubuntu (Jaunty and Karmic)
trac 0.11.1
trac-bzr 0.3.0 (Lucid package) and 0.3.2 egg in trac plugins dir, also rebuilt from source.
bazaar 0.2.something (standard Karmic package)
python 2.6

Trac seems to work but when I click on 'Browse Source' I get 'No node at revision current:'
If I then click 'search in repository' I get "AttributeError: 'NoneType' object has no attribute 'b'"
The log says:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 444, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 205, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.6/dist-packages/trac/versioncontrol/web_ui/log.py", line 105, in process_request
    rev = revranges.b
AttributeError: 'NoneType' object has no attribute 'b'

I have debugged this - trac-bzr is passing 'current:', trac is expecting an integer.
How is this working for anyone?
How do I get it to work for me?

Question information

Language:
English Edit question
Status:
Solved
For:
Trac-Bzr Edit question
Assignee:
No assignee Edit question
Solved by:
Martin Collins
Solved:
2010-04-10
Last query:
2010-04-10
Last reply:
Martin von Gagern (gagern) said : #1

I've not yet understood all the details, but I would assume that this issue can be resolved by using a more recent version of Trac. In particular, the line you are referring to seems to vanish in http://trac.edgewall.org/changeset/8406 which corresponds to Trac 0.11.6 and later.

I'm not sure where trac-bzr is passing 'current:' according to your debugging. Can you give me additional details about your debugging?

Looking at http://trac.edgewall.org/browser/tags/trac-0.11.1/trac/versioncontrol/web_ui/log.py it seems to me that setting mode=path_history and not setting either rev or revs should always lead to this error, even when using subversion. But I don't have a 0.11.1 setup here for testing. If it works for subversion but fails for trac-bzr, then maybe by understanding how it does that I can find a way to make it work even for trac 0.11.1.

Martin Collins (mkc-steadfast) said : #2

Well, I tried 0.11.6 and that didn't work either, though the error was slightly different.

That pretty much confirmed my suspicion that the problem was me. It turns out that I had set repository_dir to my .bzr directory (that's my repository, right?) but once I changed it to the directory above everything worked fine, even in 0.11.1

So, sorry to waste your time with such a newbie error, and thanks for the nice software.