Modify

Opened 2 years ago

Closed 2 years ago

Last modified 4 months 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_s
Priority: normal Component: WatchlistPlugin
Severity: normal Keywords: typeerror python
Cc: rjollos 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 2 years ago by rjollos

  • Cc rjollos added

comment:2 Changed 2 years ago by martin_s

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 2 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 2 years ago by martin_s

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 2 years ago by martin_s

  • Status changed from new to 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 2 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 2 years ago by martin_s

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

comment:8 Changed 2 years ago by anonymous

Hi,

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

Best regards, Andrei.

comment:9 Changed 2 years ago by martin_s

  • Resolution set to fixed
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from martin_s. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.