[Zope-dev] Re: [Zope] Zope-2.1.0b2 fails on access to
management screen
Jim Cain
jec@mgmt-inc.com
Mon, 22 Nov 1999 14:47:41 -0500
--On Saturday, November 20, 1999 00:02 +0100 Martijn Pieters
<mj@antraciet.nl> wrote:
> At 17:52 19-11-99 , Jim Cain wrote:
>> I tried the above changes, but I still got the same error.
>>
>> Then I tried removing things altogether, one at a time. Finally I
>> discovered that by removing the first %d on line 225 and self.addr[1] on
>> line 226, while leaving everything else alone, it works fine.
>>
>> One curious thing though: When I run it this way, the line it writes in
>> the log file begins with ^D. Where is that character coming from?
>
> Eh? This suggests that self.addr[1] is now broken, which means that it
> was previously (older Zope version) wasn't working either.. And I don't
> get the ^D either.
>
> Do you know how to use the Perl Debugger? I think a few debugging steps
> are in order here. Insert the lines
>
> import pdb
> pdb.set_trace()
>
> somewhere before the offending lines (for example, at 222), start Zope in
> debugging mode (so it won't detach from the console). Then, when you go
> to your site and your pdb statements are executed, you can follow
> exactly what goes wrong where, and why.
>
> Let us know!
Okay, I put in the set_trace, and this is what I found:
(Pdb) l
220 else:
221 method="GET"
222 if self.addr:
223 import pdb
224 pdb.set_trace()
225 -> self.server.logger.log (
226 self.addr[0],
227 '%d - - [%s] "%s %s" %d %d' % (
228 self.addr[1],
229 time.strftime (
230 '%d/%b/%Y:%H:%M:%S ',
(Pdb) whatis self.addr
<type 'string'>
(Pdb) p self.addr
'\004\010\204\364\377\277\226y'
(Pdb) p self.addr[0]
'\004'
(Pdb) p self.addr[1]
'\010'
Well at least we know where the ^D is coming from, but what is self.addr
supposed to contain, a string representation of the IP address of the
client?
Jim