Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Re/Unresolved bug?

Reply
Thread Tools

Re: Re/Unresolved bug?

 
 
Xavier
Guest
Posts: n/a
 
      06-29-2003
Steven,

Thanks a lot for your time and great reply -- I appreciate it greatly.

-- Xavier

oderint dum mutuant
----- Original Message -----
From: "Steven Taschuk" <(E-Mail Removed)>
To: <(E-Mail Removed)>
Sent: Sunday, June 29, 2003 2:48 PM
Subject: Re: Re/Unresolved bug?


> Quoth Xavier:
> [top-posting fixed]
> > From: "Steven Taschuk" <(E-Mail Removed)>
> > > Could you post a minimal example of code which provokes this
> > > behaviour?

> [...]
> > Thanks for your reply. Here is the exact, waiting to be fixed code:
> > http://sabu.net/routekill.py

>
> That is very far from a minimal example. What you should do is
> cut out some code, verify that the problem still exists, and
> repeat until you can't cut out anything without making the problem
> go away. Doing so has two advantages: first, a short example is
> much more likely to provoke responses here, and second, the
> process itself might teach you what the problem is.
>
> Having had some spare time today, I've done this for you. Here's
> the (not *quite* minimal, actually) result:
>
> def addroutes(IP, METHOD):
> global METHOD
>
> def main():
> global VERBOSE
> VERBOSE = '1'
> global VERBOSE
>
> print 'foo'
>
> On my machine, with 2.2.2 this code issues the SyntaxWarning and
> then segfaults, and on 2.3 issues the SyntaxWarning and dies
> without printing 'foo'.
>
> There are two things wrong with this code. To get it running,
> first remove the second global statement for VERBOSE. Once that's
> done, the code will start producing
> SyntaxError: name 'METHOD' is local and global
> Thus the second thing you need to do is to decide whether you want
> METHOD to be an argument to addroutes() or a global variable to
> that function, and then either remove the global statement or
> emend the argument list.
>
> Once you've done these two things the code will run; I leave
> determining whether it works to you.
>
> (Python's reaction to this code *is* buggy -- it seems that the
> SyntaxWarning interferes with the SyntaxError somehow. (My
> original suspicion that the SyntaxWarning was irrelevant was
> wrong.) I'll be looking into this today.)
>
> --
> Steven Taschuk http://www.velocityreviews.com/forums/(E-Mail Removed)
> "What I find most baffling about that song is that it was not a hit."
> -- Tony Dylan Davis (CKUA)
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments