Whenever I try to open a PDF file, I get the following error message:
Traceback (most recent call last):
File "optparse.py", line 1377, in parse_args
File "optparse.py", line 1417, in _process_args
File "optparse.py", line 1470, in _process_long_opt
File "optparse.py", line 1455, in _match_long_opt
File "optparse.py", line 1660, in _match_abbrev
optparse.BadOptionError: no such option: --multiprocessing-fork
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mcomixstarter.py", line 23, in <module>
File "mcomix/__main__.py", line 24, in main
File "mcomix/run.py", line 158, in run
File "mcomix/run.py", line 87, in parse_arguments
File "optparse.py", line 1379, in parse_args
File "optparse.py", line 1559, in error
File "optparse.py", line 1548, in exit
AttributeError: 'NoneType' object has no attribute 'write'
This only started happening when I updated to 3.2.0. PDF support was intact in 3.1.1.
Looks like this is a bug related to the new version of Pyinstaller on Windows, in combination with multiprocessing used by the PDF extractor. The internet claims that calling multiprocessing.freeze_support() is supposed to fix this problem, and we are in fact already calling that function. I can confirm that running the "unfrozen" version from source on Windows also does not exhibit the problem.
Maybe I was mistaken - it seems that the relevant code was refactored out in a4092eb4f2927ce5d600444d0b10c308148ca34d and is no no longer called when running mcomixstarter.py, which happens when MComix is frozen for Windows.
Come to think of it, it seems kind of strange that we have freeze_support() in code paths that are never run on Windows and frozen environment. Maybe we should move it to mcomixstarter.py and just be done with it?
Not sure if you are talking about this, but a code snippet like
is already present in
__main__.py.Yes, that's exactly what I was talking about. This code should be somewhere in the code path that is taken when MComix is run on Windows while frozen by Pyinstaller. From what I can see, PyInstaller is set up to run mcomixstarter.py. This file calls
mcomix.__main__.main(). Unfortunately, the mentioned code above is inif __name__ == '__main__', while it was inmain()previously when the freeze support was supposedly still working.Last edit: Oddegamra 2026-09-14