Ticket #4 (closed defect: fixed)
"dev.py -D" traceback when content and suffix clash?
| Reported by: | Randy Selzler <RSelzler@…> | Owned by: | sheep |
|---|---|---|---|
| Priority: | Milestone: | ||
| Component: | Hatta Wiki | Version: | 1.3.3dev |
| Keywords: | index | Cc: |
Description
Tried using "dev.py -D" with my real docs tree, but failed.
I simplified the content to just a couple pages that failed
I get the following traceback (not sure how to quote it in trac).
bash$ ./dev.py -D
Traceback (most recent call last):
File "build/bdist.linux-i686/egg/wsgiref/handlers.py", line 92, in run
self.result = application(self.environ, self.start_response)
File "/var/lib/python-support/python2.6/werkzeug/utils.py", line 1694, in <lambda>
return _patch_wrapper(f, lambda *a: f(*a)(*a[-2:]))
File "/home/randy/HATTA/hatta-dev-D/hatta.py", line 3284, in application
return endpoint(request, values)
File "/home/randy/HATTA/hatta-dev-D/hatta.py", line 2678, in save
self.index.update(self, request)
File "/home/randy/HATTA/hatta-dev-D/hatta.py", line 1542, in update
self.reindex(wiki, request, changed)
File "/home/randy/HATTA/hatta-dev-D/hatta.py", line 1511, in reindex
self.reindex_page(page, title, cursor)
File "/home/randy/HATTA/hatta-dev-D/hatta.py", line 1485, in reindex_page
self.update_links(title, extract_links(text), cursor=cursor)
TypeError: <lambda>() takes no arguments (1 given)
==============================
The docs directory only has about 3 pages.
Before each test, the .hg repository is deleted, reinitialized,
pages are added and committed. Also before each test, the Hatta
cache is removed before starting the server.
I start the server (remembering to use '-D' !!!).
I browse to the 'Home' page and it displays correctly (with lots
of non-trivial markup). The "Menu" area is blank, as usually
when starting with an empty cache. I browse to the 'Menu',
click Edit, then simply click 'Save' (without any change).
This sequence is how I usually correct the Menu area.
Now here is the weird part, which is hopefully significant
to you... If I copy the 'Home' page to 'hat.py' or 'hat.c',
then repeat the test, the traceback occurs when I attempt to
'Save' the Menu Edit... All the pages are exactly the same
(Home, Menu and one more stray page) except for one new page
(either hat.py or hat.c) which has exactly the same content
as the Home page.
Do the clues mean anything to you?
-- Randy
Change History
comment:1 Changed 2 years ago by sheep
- Keywords index added
- Status changed from new to closed
- Version set to 1.3.3dev
- Resolution set to fixed
comment:2 Changed 2 years ago by Randy Selzler <RSelzler@…>
Okay, that particular test now passes.
Now I'm getting this traceback...
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/wsgiserver/init.py", line 1174, in communicate
req.respond()
File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/wsgiserver/init.py", line 544, in respond
self._respond()
File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/wsgiserver/init.py", line 556, in _respond
response = self.wsgi_app(self.environ, self.start_response)
File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/wsgiserver/init.py", line 176, in call
return app(environ, start_response)
File "/var/lib/python-support/python2.6/werkzeug/utils.py", line 1694, in <lambda>
return _patch_wrapper(f, lambda *a: f(*a)(*a[-2:]))
File "./hatta.py", line 3288, in application
return endpoint(request, values)
File "./hatta.py", line 2682, in save
self.index.update(self, request)
File "./hatta.py", line 1546, in update
self.reindex(wiki, request, changed)
File "./hatta.py", line 1515, in reindex
self.reindex_page(page, title, cursor)
File "./hatta.py", line 1484, in reindex_page
text = get_text()
TypeError: <lambda>() takes exactly 1 argument (0 given)
The test scenario is nearly the same.
It works with two pages in docs (Home and Menu).
I can Edit Menu and Save it okay.
The traceback occurs if a third file exists, docs/lightbulb.gif
The traceback occurs upon the Menu Save.
Happy hunting :)
-- Randy

This is actually not related to the -D option, I make a mistake when refactoring the page reindexing code. I fixed it now in the development repository (changeset 752:4c870a3ff2cc), thank you for the report.
Please test.