Mark Dickinson added the comment:
Thanks for the report.
This is expected behaviour. It isn't actually anything to do with
multiprocessing; it's to do with invoking exec from within a function scope.
You can see the same effect with code like this:
code = """\
def show_name():
print
New submission from David M. Rogers :
Python Devs,
There is an issue relating to variable lookup using exec from within
multiprocessing's fork()-ed process. I'm attempting to use the forked process
as a generic remote python shell, but exec is unable to reach variables from
within function