Re/Unresolved bug?

John Machin sjmachin at
Mon Jun 30 14:07:30 CEST 2003

Steven Taschuk <staschuk at> wrote in message news:<mailman.1056912287.3256.python-list at>...

> 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'.

With the above code in a file called, here are some perhaps
illuminating results from the Win32 2.2.3 Python:

C:\junk>python SyntaxWarning: name 'VERBOSE' is assigned to before global
  def main():

Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on
Type "help", "copyright", "credits" or "license" for more information.
>>> import fugly
XXX rd_object called with exception set
warning: name 'VERBOSE' is assigned to before global declaration
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "", line 1
    def addroutes(IP, METHOD):
SyntaxError: name 'METHOD' is local and global

N.B. no crashes.

Hope this helps,

More information about the Python-list mailing list