Zope GetSlice Bug
aka Get Slice
One solution: http://groups.yahoo.com/group/zope/message/113482
Test case to focus on --BillSeitz, 2003/07/01 18:12 GMT
Most obvious in just trying to list the wiki contents, but since that's horribly long let's try something simpler.
http://188.8.131.52/fluxent/webseitz/wiki/manage_propertiesForm will be the page I try to get to.
So I need to figure out how to stop before the 'eval' to look at the values of the params.
trying to debug --BillSeitz, 2003/07/04 13:14 GMT
per <http://www.zope.org/Documentation/Books/ZDG/current/Testing And Debugging.stx>
But after doing the import, when I try 'Z Publisher.Zope('/fluxent/webseitz/wiki/manage_propertiesForm')' it spits out a 401 (Unauthorized) response. Nothing in the docs says this will happen. I wonder if you can't use this method on ZMI URLs?
trying zLOG as another approach --BillSeitz, 2003/07/15 17:22 GMT
to dump values like 'action' and 'URL' - (note that Z Log dumps msg to console, not to a file (for me) which causes problems when there's too much stuf)
but I keep getting error like "global name 'URL' is not defined"
- http://zope.nipltd.com/public/lists/zope-archive.nsf/47ba74c812dbc5dd8025687f0024bb5f/519d0a5bd38e85c080256b5d00788ca1?OpenDocument |similar problem
- pointing to http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html#c37ac15c14b5 |this
- which makes it seem like I need to pass an argument somewhere, but I'm not really working at that level, so I don't know what to do, short of messing with code further up the stack (e.g. passing REQUEST into the containing method) which sounds like a bad idea.
back to debug process --BillSeitz, 2003/07/15 23:21 GMT
following Jul4 document, but different process - " Interactive Debugging Triggered From the Web"
- insert this into *.py code where you want to set a breakpoint::
import pdb pdb.set_trace()
then start up Zope normally (but with the -d flag)
then request the appropriate URL from the browser - console will pop you into debugger at that breakpoint. I hope.
seems to work --BillSeitz, 2003/07/16 02:32 GMT
Gets into pdb. Here's pdb http://www.python.org/doc/current/lib/debugger-commands.html |docs
type 'n' to skip ahead from inside of set_trace - end up at 'eval(code,d)'
type 'p d' to print value of 'd' and get pile of HTML which looks like output of the dtml-request method (Jun25)
trying 'p code' spits out that you have a 'type code' object - 'p str(code)' doesn't do you any good.
- 'p dir(code)' gives list of attributes(?) including 'co_code'; some research says that's of type 'object'? Shows referenced as 'code.co_code'; 'p type(code.co_code)' returns 'string'. But 'p code.co_code' outputs some shmutz - UniCode?
let's move along. Try an 's' to step in. Hmmm, I just continue to get lost. It seems to loop back around to that same 'exec' over and over again - I don't know if I've already triggered the error, or if that happens later on. If I try doing 'c' it repeats something else - I think now it's generating the error traceback page. The browser gets the page eventually. If I request the page again it doesn't seem to go into pdb, I end up with some other traceback involving 'raise bdb.BdbQuit'
Will try some more tomorrow.
code objects --BillSeitz, 2003/07/16 02:37 GMT
ah, that's a pointer to pseudo-compiled code - see here and find "code objects"
have no clue how to move forward --BillSeitz, 2003/07/16 21:21 GMT
Tried setting the breakpoint at various places, but I honestly have no idea what I'm even looking for.
If a 3rd party isn't going to save my bacon, I need to figure out a new approach.
perfect timing! --BillSeitz, 2003/07/16 21:33 GMT
Jamie Heilman pointed out the problem must be from having an object named 'URL' in the folder. That's it! He suggested a code change (in 'manage_tabs.dtml'), but I just settled for removing the object.