Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
sys.exit called on rst parse errors #1759
The docutils.core.Publisher backend is called in a such a way that it doesn't raise an Exception, but calls sys.exit instead. This makes it harder to use pelican as library.
How to reproduce this?
Using an rst file with invalid syntax, run:
This is caused because of
Unfortunately, I don't know enough about the internal structure of Pelican to suggest where the docutils Exception should be changed into a sys.exit, but I'm inclined to say this should be close to the entry point. This allows people who call Pelican as a library to catch an Exception as-is, instead of resorting to the workaround
I'm not sure why this was considered a good idea in the first place. Exiting the process for an error in a single