Modify

Opened 12 years ago

Closed 12 years ago

Last modified 6 years ago

#9939 closed defect (fixed)

"TypeError: generate() keywords must be strings" Python 2.6 and trac 0.12

Reported by: margineanu.andrei@… 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 12 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; anonymous removed

comment:2 Changed 12 years ago by Martin Scharrer

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.

comment:3 Changed 12 years ago by anonymous

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 12 years ago by Martin Scharrer

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 12 years ago by Martin Scharrer

Status: newassigned

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 12 years ago by anonymous

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 12 years ago by Martin Scharrer

Sorry, there was a minor error in my last change. Try r11454, which should work.

comment:8 Changed 12 years ago by anonymous

Hi,

Thanks a lot for the update, the fix works great :)

Best regards, Andrei.

comment:9 Changed 12 years ago by Martin Scharrer

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Martin Scharrer.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.