[New-bugs-announce] [issue13220] print function unable while multiprocessing.Process is being run

ben report at bugs.python.org
Wed Oct 19 17:28:02 CEST 2011


New submission from ben <thelen_ben at yahoo.com>:

print function unable while multiprocessing.Process is being run

Not sure if this really is a bug, but the multiprocessing.Process (or Pool) does not allow to print during multiprocessing tasks.

I've copied the example from The Python V3.2.2 documentation, library reference, multiprocessing (3rd example).

My systems details are: MS windows xp or Windows 7, IDLE, Python 3.2.2 [MSC v.1500 32 bit (Intel)] on win32

from multiprocessing import Process
import os

def info(title):
    print(title)
    print('module name:', __name__)
    print('parent process:', os.getppid())
    print('process id:', os.getpid())

def f(name):
    info('function f')
    print('hello', name)

if __name__ == '__main__':
    info('main line')
    p = Process(target=f, args=('bob',))
    p.start()
    p.join()


#return

#main line
#module name: __main__
#parent process: 1588
#process id: 3700

#but function f doesn't get printed.

----------
components: Library (Lib)
files: mp.py
messages: 145913
nosy: Ben.thelen
priority: normal
severity: normal
status: open
title: print function unable while multiprocessing.Process is being run
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file23463/mp.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13220>
_______________________________________


More information about the New-bugs-announce mailing list