Zope GetSlice Bug

aka Get Slice

Problem: http://groups.yahoo.com/group/zope/message/113478

One solution: http://groups.yahoo.com/group/zope/message/113482

tested that URL is a string --BillSeitz, 2003/06/25 17:17 GMT
http://webseitz.fluxent.com/wiki/dtmlrequest shows::

URL 'http://webseitz.fluxent.com/wiki/dtmlrequest'

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://216.17.130.14/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"

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)

    • I see URL0-URL4, but no URL - ah, it's there but in a different location. It looks like a string, just like in the dtml-request method.
  • 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.


Edited:    |       |    Search Twitter for discussion