gallery_get
gallery_get copied to clipboard
Using gallery_get in multiprocessing environment internal thread exception kills process
When encountering this exception (with gallery_get 1.7.12) --
Traceback (most recent call last): File "P:\v_Tools\GALLERY_GET_VENV\lib\site-packages\gallery_get.py", line 321, in run self.run_internal() File "P:\v_Tools\GALLERY_GET_VENV\lib\site-packages\gallery_get.py", line 307, in run_internal self.process_redirect_page(info, response) File "P:\v_Tools\GALLERY_GET_VENV\lib\site-packages\gallery_get.py", line 278, in process_redirect_page jpegs = run_match(info.plugin.direct,unicode_safe(source)) File "P:\v_Tools\GALLERY_GET_VENV\lib\site-packages\gallery_get.py", line 89, in run_match for curmatch in rematch.finditer(source): TypeError: cannot use a string pattern on a bytes-like object
The entire process is killed by the run() method in ImgThread class making an os._exit(1) call on line 329,
Wouldn't it be okay just to let the thread terminate without doing the _exit() call?
I commented out the _exit() and only lost the one image that caused the exception.
Would you be willing to share the URL you used that resulted in the exception? You could pm me if you don't want to share it publicly.
I have a possible workaround for the particular exception. As for continuing instead of calling _exit(), that would bury the exception message in the middle of the log output. What I could do is collect the exception, not call _exit(), and then compile a summary of exceptions to print at the very end.
That sounds like a good idea -- a list of exceptions. I will email you the URL.