#9939 closed defect (fixed)
"TypeError: generate() keywords must be strings" Python 2.6 and trac 0.12
Reported by: | Owned by: | Martin Scharrer | |
---|---|---|---|
Priority: | normal | Component: | WatchlistPlugin |
Severity: | normal | Keywords: | typeerror python |
Cc: | Ryan J Ollos | Trac Release: | 0.12 |
Description
Hi, We installed the WatchlistPlugin on our company server after making the update to trac 0.12. When watching any wiki page the following error occurs:
TypeError: generate() keywords must be strings
- in : "<path>/egg/trac/web/chrome.py", line 812, in render_template
- line 812: stream = template.generate(data)
- data: {'datetime_format': u'%Y-%m-%d %H:%i:%s', 'all': <built-in function all>, ...
It might be related to the python handling of unicode strings. See here and and here.
Thanks in advance.
Attachments (0)
Change History (9)
comment:1 Changed 13 years ago by
Cc: | Ryan J Ollos added; anonymous removed |
---|
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Hi,
Thanks a lot for the quick update. Here is the log:
2012-04-04 10:47:56,711 Trac[main] ERROR: Internal Server Error: Traceback (most recent call last): File "build/bdist.linux-i686/egg/trac/web/main.py", line 513, in _dispatch_request dispatcher.dispatch(req) File "build/bdist.linux-i686/egg/trac/web/main.py", line 256, in dispatch content_type) File "build/bdist.linux-i686/egg/trac/web/chrome.py", line 812, in render_template stream = template.generate(**data) TypeError: generate() keywords must be strings
comment:4 Changed 13 years ago by
Strange, the tracelog should go all the way to the plugin. I was hoping to find the exact location in the plugin source code this way.
comment:5 Changed 13 years ago by
Status: | new → assigned |
---|
I now changed the code to ensure that the keywords are strings. Please try r11452 and tell me if it fixes the issue. Note that I can't replicate the error with Python 2.6.7 or 2.7.2+. Would you be able to update your Python installation, at least to a higher 2.6.x version?
comment:6 Changed 13 years ago by
Hi, Thank you for the update. I tried the fix but now I get a different error:
NameError: global name 'wldict' is not defined
in line 419: wldict['action'] = action
The Python version will not be updated because of the possible risks, so we're stuck with it - 2.6 r26:66714, Dec 3 2008, 06:05:48.
I think it's no longer a problem of the plugin. You can close the ticket.
Thank you.
comment:7 Changed 13 years ago by
Sorry, there was a minor error in my last change. Try r11454, which should work.
comment:8 Changed 13 years ago by
Hi,
Thanks a lot for the update, the fix works great :)
Best regards, Andrei.
comment:9 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Looks indeed that one of the keywords is in unicode and not a string. I have the feeling that this is only an issue with Python 2.6 and not with 2.7. Please check your log file for a trace-back and post it here. This would help me. Thanks.