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 TarkaSteve
Recipients TarkaSteve
Date 2008-09-06.04:53:03
SpamBayes Score 2.2093036e-06
Marked as misclassified No
Message-id <1220676786.79.0.371553586642.issue3792@psf.upfronthosting.co.za>
In-reply-to
Content
The process variable 'p' is leaking into sub-processes when using the
multiprocessing modules.  The following code demonstrates the problem:

    import sys
    from multiprocessing import Process

    p = 'Correct'

    def test():
        print "Got 'p' of", p

    if __name__ == '__main__':
        if len(sys.argv) == 2 and sys.argv[1] == '-m':
            p = Process(target=test)
            p.start()
            p.join()
        else:
            test()

Running this in SP and MP mode shows the leakage:

    ssmith$ /opt/python-svn/bin/python mpbug.py 
    Got 'p' of Correct
    ssmith$ /opt/python-svn/bin/python mpbug.py -m
    Got 'p' of <Process(Process-1, started)>

This occurs in both 2.6b3 and trunk.
History
Date User Action Args
2008-09-06 04:53:07TarkaStevesetrecipients: + TarkaSteve
2008-09-06 04:53:06TarkaStevesetmessageid: <1220676786.79.0.371553586642.issue3792@psf.upfronthosting.co.za>
2008-09-06 04:53:05TarkaStevelinkissue3792 messages
2008-09-06 04:53:04TarkaStevecreate