This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Orlowski
Recipients LambertDW, Orlowski, loewis
Date 2009-01-29.10:53:17
SpamBayes Score 8.643086e-13
Marked as misclassified No
Message-id <498181FA.9070004@genesilico.pl>
In-reply-to <1233196157.85.0.99936146684.issue5092@psf.upfronthosting.co.za>
Content
I still do not understand what is going on when python executed thic 
code. I have a local variable l in my parent process. When I create a 
child process, program makes first makes a copy of memory. Than what?

I am sure that l still exists in child process because
1. It can be printed
2. It has still a lot of memory allocated for it

You say that l does not exist as a local variable in child process. Is 
it global? How can I dealocate it in child process?

Jerzy

Martin v. Löwis pisze:
> Martin v. Löwis <martin@v.loewis.de> added the comment:
> 
> As David says, this is not a bug. del l indicates that there is a local
> variable to be deleled, but when the del statement is executed, there is
> no local variable. The error message is confusing in this case: there
> actually is no later assignment to l (in the function at all).
> Typically, when you have an unbound local, it is because of a later
> assignment, such as
> 
> def foo():
>   a = l + 1
>   l = 2
> 
> In this specific example, there is no later assignment - yet it is still
> an unbound local.
> 
> So that you get the exception is not a bug.
> 
> I was going to suggest that the error message could be better, but I
> can't think of any other error message that is better and still correct,
> hence closing it as won't fix.
> 
> ----------
> nosy: +loewis
> resolution:  -> wont fix
> status: open -> closed
> 
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue5092>
> _______________________________________
> 
> 
>
History
Date User Action Args
2009-01-29 10:53:47Orlowskisetrecipients: + Orlowski, loewis, LambertDW
2009-01-29 10:53:20Orlowskilinkissue5092 messages
2009-01-29 10:53:17Orlowskicreate