Ticket #1200 (closed defect: fixed)
kid-0.9.4: generate_content() takes exactly 1 argument (2 given)
| Reported by: | jeffk | Owned by: | jorge.vargas |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.3 |
| Component: | Kid | Version: | trunk |
| Severity: | normal | Keywords: | kid |
| Cc: |
Description
from svn trunk checkout, installed with "python setup.py develop", kid-0.9.4 is downloaded from PyPI (or it might reasonably have been installed/upgraded manually).
tg-admin toolbox' catwalk and widget browser have the following similar errors with kid-0.9.4. Perhaps an easy and localized fix is available which can make toolbox more tolerant of upgraded kid package versions until these migrate from kid to genshi.
http://localhost:7654/widgets/
500 Internal error
The server encountered an unexpected condition which prevented it from fulfilling the request.
Page handler: <function _wrapper at 0x889ebc4>
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in _run
self.main()
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 254, in main
body = page_handler(*virtual_path, **self.params)
File "/software/svn/turbogears/turbogears/identity/conditions.py", line 275, in _wrapper
return fn( *args, **kw )
File "<string>", line 3, in index
File "/software/svn/turbogears/turbogears/controllers.py", line 284, in expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File "/software/svn/turbogears/turbogears/database.py", line 251, in so_rwt
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/software/svn/turbogears/turbogears/controllers.py", line 301, in <lambda>
mapping, fragment, args, kw)))
File "/software/svn/turbogears/turbogears/controllers.py", line 341, in _execute_func
return _process_output(output, template, format, content_type, mapping, fragment)
File "/software/svn/turbogears/turbogears/controllers.py", line 81, in _process_output
mapping=mapping, content_type=content_type,fragment=fragment)
File "/software/svn/turbogears/turbogears/view/base.py", line 125, in render
return adapt_call(engine.render, **dict(info=info, format=format, fragment=fragment, template=template, mapping=mapping))
File "/software/svn/turbogears/turbogears/util.py", line 165, in adapt_call
return func(*args, **kw)
File "/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 174, in render
return t.serialize(encoding=self.defaultencoding, output=format, fragment=fragment)
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/__init__.py", line 283, in serialize
return serializer.serialize(self, encoding, fragment, format)
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 109, in serialize
text = ''.join(tuple(
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 630, in generate
for ev, item in self.apply_filters(stream, format):
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 165, in format_stream
for ev, item in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 218, in _coalesce
for ev, item in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 480, in inject_meta_tags
for ev, item in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 174, in _track
for p in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/filter.py", line 22, in apply_matches
for ev, item in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 174, in _track
for p in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 218, in _coalesce
for ev, item in stream:
File "/software/svn/turbogears/turbogears/toolbox/widgets/widgets.py", line 167, in _pull
TypeError: generate_content() takes exactly 1 argument (2 given)
Powered by CherryPy 2.2.1
http://localhost:7654/catwalk/
500 Internal error
The server encountered an unexpected condition which prevented it from fulfilling the request.
Page handler: <function _wrapper at 0x88db95c>
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in _run
self.main()
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 254, in main
body = page_handler(*virtual_path, **self.params)
File "/software/svn/turbogears/turbogears/identity/conditions.py", line 275, in _wrapper
return fn( *args, **kw )
File "<string>", line 3, in index
File "/software/svn/turbogears/turbogears/controllers.py", line 284, in expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File "/software/svn/turbogears/turbogears/database.py", line 251, in so_rwt
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/software/svn/turbogears/turbogears/controllers.py", line 301, in <lambda>
mapping, fragment, args, kw)))
File "/software/svn/turbogears/turbogears/controllers.py", line 341, in _execute_func
return _process_output(output, template, format, content_type, mapping, fragment)
File "/software/svn/turbogears/turbogears/controllers.py", line 81, in _process_output
mapping=mapping, content_type=content_type,fragment=fragment)
File "/software/svn/turbogears/turbogears/view/base.py", line 125, in render
return adapt_call(engine.render, **dict(info=info, format=format, fragment=fragment, template=template, mapping=mapping))
File "/software/svn/turbogears/turbogears/util.py", line 165, in adapt_call
return func(*args, **kw)
File "/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 174, in render
return t.serialize(encoding=self.defaultencoding, output=format, fragment=fragment)
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/__init__.py", line 283, in serialize
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 109, in serialize
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 630, in generate
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 165, in format_stream
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 218, in _coalesce
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 480, in inject_meta_tags
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 174, in _track
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/filter.py", line 22, in apply_matches
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 174, in _track
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 218, in _coalesce
File "/software/svn/turbogears/turbogears/toolbox/catwalk/catwalk.py", line 37, in _pull
TypeError: generate_content() takes exactly 1 argument (2 given)
Powered by CherryPy 2.2.1
Change History
comment:2 Changed 6 years ago by jeffk
- Keywords catwalk widgets toolbox removed
- Summary changed from kid: easy_install default kid-0.9.4 toolbox catwalk, widget browser errors to kid-0.9.4: generate_content() takes exactly 1 argument (2 given)
Changing the description summary on this ticket to reflect a general problem with many TurboGears apps (e.g. WhatWhat?, ToscaWidgets?' tgsample, etc.) when using kid-0.9.4 instead of kid-0.9.3.
TurboKid? trunk install_requires = ["kid >= 0.9.1"], kid-0.9.3 is probably the latest expected version, but kid-0.9.4 may happen to be installed via normal easy_install upgrade.
It would be helpful if TurboKid? or other component could be patched to handle kid-0.9.4 (tagged 2006-11-26) or give the appropriately descriptive error message if kid-0.9.4 can't be supported at this time.
2007-01-07 21:59:37,765 cherrypy.msg INFO HTTP: Page handler: <bound method Root.index of <tgsample.controllers.Root object at 0x87473cc>>
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in _run
self.main()
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 254, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in index
File "/software/svn/turbogears11/turbogears/controllers.py", line 284, in expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File "/software/svn/turbogears11/turbogears/database.py", line 249, in so_rwt
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/software/svn/turbogears11/turbogears/controllers.py", line 301, in <lambda>
mapping, fragment, args, kw)))
File "/software/svn/turbogears11/turbogears/controllers.py", line 341, in _execute_func
return _process_output(output, template, format, content_type, mapping, fragment)
File "/software/svn/turbogears11/turbogears/controllers.py", line 81, in _process_output
mapping=mapping, content_type=content_type,fragment=fragment)
File "/software/svn/turbogears11/turbogears/view/base.py", line 126, in render
return adapt_call(engine.render, **dict(info=info, format=format, fragment=fragment, template=template, mapping=mapping))
File "/software/svn/turbogears11/turbogears/util.py", line 166, in adapt_call
return func(*args, **kw)
File "/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 174, in render
return t.serialize(encoding=self.defaultencoding, output=format, fragment=fragment)
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/__init__.py", line 283, in serialize
return serializer.serialize(self, encoding, fragment, format)
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 109, in serialize
text = ''.join(tuple(
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 630, in generate
for ev, item in self.apply_filters(stream, format):
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 165, in format_stream
for ev, item in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 218, in _coalesce
for ev, item in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/serialization.py", line 480, in inject_meta_tags
for ev, item in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 174, in _track
for p in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/filter.py", line 36, in apply_matches
template, templates[:i] + templates[i+1:], apply_func):
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/filter.py", line 36, in apply_matches
template, templates[:i] + templates[i+1:], apply_func):
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/filter.py", line 22, in apply_matches
for ev, item in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 174, in _track
for p in stream:
File "/usr/lib/python2.4/site-packages/kid-0.9.4-py2.4.egg/kid/parser.py", line 218, in _coalesce
for ev, item in stream:
File "/software/svn/turbogears11/turbogears/view/templates/sitetemplate.py", line 45, in _match_func
TypeError: generate_content() takes exactly 1 argument (2 given)
Downgrading to kid-0.9.3 eliminates errors of this kind.
comment:3 Changed 6 years ago by chrisz
Note that this is not a bug in Kid 0.9.4, but an incompatibility between Kid templates which have been compiled with Kid 0.9.3 with the Kid 0.9.4 library. The problem can be solved by removing all these old compiled templates (*.pyc files belonging to *.kid templates). Starting with Kid 0.9.5, Kid templates are recompiled automatically so this will not be an issue any more.
comment:4 follow-up: ↓ 5 Changed 6 years ago by jorge.vargas
- Owner changed from anonymous to jorge.vargas
- Milestone set to 1.0.2
I'll make the bump in source:browser/projects/TurboKid/tags/0.9.9/setup.py
if everyone is ok with it.
comment:5 in reply to: ↑ 4 Changed 6 years ago by alberto
Replying to jorge.vargas:
I'll make the bump in source:browser/projects/TurboKid/tags/0.9.9/setup.py
if everyone is ok with it.
+1
Alberto
The problem is in the template recompilation. If you delete /software/svn/turbogears/turbogears/toolbox/catwalk/catwalk.pyc and widget.pyc, you don't get the error.
If you execute:
You can view the python generated by the template. The problem is kid have not a field for identify the version of the compilation, and only recompile the templates by modification time. Adding this check to kid, will fix the problem.
I'll open the ticket in kid project. ¿It's necesary code a workarround?
Excuse me for my bad english.