Offline documentation: FileNotFoundError in process_source_files.py

Trying to generate the offline documentation, after installing Doxygen and GraphViz.
I’m on Mac OS X 10.14.3 - So Python is installed. JUCE 5.4.4

I’m getting a FileNotFoundError from the python script on line 80, which I’m finding difficult to troubleshoot. Here’s the block:

if __name__ == "__main__":

    parser = argparse.ArgumentParser()
    parser.add_argument("source_dir",
                        help="the directory to search for source files")
    parser.add_argument("dest_dir",
                        help="the directory in which to place processed files")
    parser.add_argument("--subdirs",
                        help="if specified, only include these comma separated"
                             "subdirectories")
    args = parser.parse_args()

    try: 
        shutil.rmtree(args.dest_dir)
    except FileNotFoundError:
        pass

It’s the exception of course…
Terminal output:

% make
python process_source_files.py ../modules build
Traceback (most recent call last):
  File "process_source_files.py", line 80, in <module>
    except FileNotFoundError:
NameError: name 'FileNotFoundError' is not defined
make: *** [build/juce_modules.dox] Error 1

… OR the FileNotFoundError is not defined?
What am I missing? Hope any of you fine folks can help. Thanks! :slight_smile:

Hmm… Could it be that the python script is trying to remove the ‘docs’ folder:

shutil.rmtree(args.dest_dir)

but it’s not there:so it’s defaulting to the FileNotFoundError, which for some reason is causing an error?

Yes, that was the problem. Commented out the try/except block, and that solved it.

Feel free to delete my post, if you feel it’s obsolete. But just a heads up, that the try/except breaks if the docs folder isn’t present.

Ah, FileNotFoundError is Python2 only. I’ll get that fixed, thanks for reporting.