Modify ↓
Ticket #296 (closed defect: fixed)
'unicode' object has no attribute 'partition'
| Reported by: | hkunz@… | Owned by: | moschny |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | trac.tracnav | Version: | tracnav-devel |
| Severity: | normal | Keywords: | |
| Cc: | christian@… |
Attachments
Change History
comment:2 Changed 5 years ago by christian@…
- Cc christian@… added
A little further research has revealed that this is a python 2.4 issue with TracNav. Line 129 of tracnav.py:
for arg, _, values in map(lambda s: s.partition('='), args.split('|')):
The partition method is added to the string class as of Python 2.5 (as shown here: http://bytes.com/forum/thread537988.html among other places).
I guess Python 2.5 should be listed as a requirement or the above line should be rewritten to work without the partition method.
comment:3 Changed 5 years ago by christian@…
Update:
Being a little desperate I decided to hack this to work. I followed the steps below to make TracNav work with my Python 2.4 setup.
- Get the source from SVN
- Edit tracnav.py from line 129 - my file looks like this after edit
#Commented out to ignore Python 2.4 issues #Using hardcoded config instead self.collapse = True self.modify = True self.reorder = True #for arg, _, values in map(lambda s: s.partition('='), args.split('|')): # arg = arg.strip() # if arg == 'nocollapse': # self.collapse = False # elif arg == 'noedit': # self.modify = False # elif arg == 'noreorder': # self.reorder = False # elif arg == 'allowed_macros': # self.allowed_macros = map(lambda s: s.strip(), values.split(',')) # else: # self.names.append(arg) - Remove any old installs of TracNav
- Build and install the modified version
Note: This approach has the following drawbacks:
- No configuration possible from Trac
- You TOC MUST be at /wiki/TOC (this can possibly also be hardcoded..)
- Possibly others - I intent to use this only untill a fix is released or I upgrade to python 2.5
Note: See
TracTickets for help on using
tickets.

I see the same issue. My setup is as follows:
Every page with TracNav shows a: