Opened 13 years ago
Closed 13 years ago
#8985 closed defect (invalid)
fail on fresh install CentoOS 5.6
Reported by: | anonymous | Owned by: | Roberto Longobardi |
---|---|---|---|
Priority: | normal | Component: | TestManagerForTracPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Most recent call last:
Traceback (most recent call last):
File "build/bdist.linux-i686/egg/trac/web/main.py", line 511, in _dispatch_request File "build/bdist.linux-i686/egg/trac/web/main.py", line 192, in dispatch File "build/bdist.linux-i686/egg/trac/core.py", line 78, in extensions File "build/bdist.linux-i686/egg/trac/core.py", line 213, in getitem File "build/bdist.linux-i686/egg/trac/core.py", line 119, in maybe_init File "build/bdist.linux-i686/egg/testmanager/api.py", line 88, in init
AttributeError: 'unicode' object has no attribute 'partition'
Attachments (0)
Change History (3)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Summary: | fail on fresh install → fail on fresh install CentoOS 5.6 |
---|
I hacked up the partition/rpartition stuff with split and rsplit. I doing so there are too many places where the path is being analyzed and where the same bits of code exist over and over. These path functions SHOULD be refactored into the util.py module to reduce chance for bugs like the one in get_enclosing_catalog in model.py
else: #cat_id = page_name.rpartition('TT')[0].page_name.rpartition('TT')[2].rpartition('_')[0] # XXX THIS LOOKS LIKE A BUG. STRING FROM FIRST rpartition WILL NOT HAVE ATTRIBUTE page_name cat_id = page_name.rsplit('TT',1)[0].rsplit('TT',1)[-1].rsplit('_',1)[0]
comment:3 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Hi, I guess the problem is your Python version.
Only versions 2.5+ are supported. See also #4846.
Consider that Python 2.4 is not supported by Trac either.
I'll think about using split instead of partition. In the meantime, you can add the following functions to "utils.py":
def partition(str, ch): idx = str.find(ch) if idx >= 0: return (str[0:idx], ch, str[idx+1:]) else: return (str,'','') def rpartition(str, ch): idx = str.rfind(ch) if idx >= 0: return (str[0:idx], ch, str[idx+1:]) else: return ('','',str)
And replace every occurrence of their use as follows:
somestring.partition('A') ====> partition(somestring, 'A')
somestring.rpartition('A') ====> rpartition(somestring, 'A')
Ciao, Roberto
api.py
partition('.')[0]partition('.')[2].lower()rpartition('_TT')[2]