Aug-16-2017, 06:42 PM
Hello
I don't know if this is the correct forum for this but General Coding Help sounded right.
I'm writing a multiprocess program and I communicate using queues.
I noticed that I was getting errors some of the time... intermittent... no pattern to it.
The error only occurs when I use exit() to terminate the program. I realize an exit() at the end of the program doesn't make any sense, but this is just minimal code to reproduce the error.
I can't find a way to shut down the manager server and the queues before exiting as neither the manager object or the proxied queue object seem to have any relevant functions.
The minimal code I use to reproduce it is:
I don't know if this is the correct forum for this but General Coding Help sounded right.
I'm writing a multiprocess program and I communicate using queues.
I noticed that I was getting errors some of the time... intermittent... no pattern to it.
The error only occurs when I use exit() to terminate the program. I realize an exit() at the end of the program doesn't make any sense, but this is just minimal code to reproduce the error.
I can't find a way to shut down the manager server and the queues before exiting as neither the manager object or the proxied queue object seem to have any relevant functions.
The minimal code I use to reproduce it is:
import multiprocessing if __name__ == '__main__': multiprocessing.freeze_support() ''' Create a Manager object to handle IPC queues ''' manager=multiprocessing.Manager() work_q=manager.Queue() exit(0)Most times this works and generates no error, but sometimes it generates the following error:
Error:"C:\Program Files\Python35\python.exe" "S:/Code/Python/Video Recode/Video Recode/VideoRecode.py"
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x000002DFEAFCA2F0>
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x000002DFEAFCA2F0>
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x000002DFEAFCA2F0>
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable
Process finished with exit code 0