multiple threads from file error
th3illu opened this issue · comments
File "Python\Python38-32\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
Process Process-1:
File "Python\Python38-32\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "4chdl\inb4404.py", line 44, in download_thread
if args.use_names or os.path.exists(os.path.join(workpath, 'downloads', board, thread_tmp)):
AttributeError: 'NoneType' object has no attribute 'use_names'
Traceback (most recent call last):
File "Python\Python38-32\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "Programs\Python\Python38-32\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "4chdl\inb4404.py", line 44, in download_thread
if args.use_names or os.path.exists(os.path.join(workpath, 'downloads', board, thread_tmp)):
AttributeError: 'NoneType' object has no attribute 'use_names'
Please download the current version of this script, don't modify anything and try again.
How exactly are you trying to execute this script?
Same here. Python 3.8.3 64-bit, tried standard CMD, powershell and even on Linux, gives the same error all the time. Tried running it by python inb4404.py threads.txt
. This version of python is the only one installed so no py2 happening.
EDIT: it's on line 68 because I edited the code a bit. In your version, the error is on line 65.
I believe the cause of the issue lies with how Python starts child processes on different platforms. On Unix the default start method is "fork", which creates a child process identical to the parent process. On Windows the default (and only available) start method is "spawn", which starts a fresh Python interpreter process.
https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
Passing args
as additional parameter to download_thread
fixes the issue.