sphinxcontrib-towncrier
sphinxcontrib-towncrier copied to clipboard
Error in get_outdated_docs when framents dir missing
Towncrier runs fine if the newsfragments directory doesn't exist.
This plugin will fail if the directory doesn't exist with this error:
Extension error (sphinxcontrib.towncrier.ext):
Handler <bound method TowncrierDraftEntriesEnvironmentCollector.get_outdated_docs of <sphinxcontrib.towncrier.ext.TowncrierDraftEntriesEnvironmentCollector object at 0x1075c3990>> for event 'env-get-outdated' threw an exception (exception: Failed to list the news fragment files.
FileNotFoundError: [Errno 2] No such file or directory: '../newsfragments/'
)
This plugin should honor the degenerate newsfragments including no directory, same as towncrier.
Fair enough. This needs to be fixed.
Hey there, I'm intersted in contributing to this issue do let me know how I can help
@adkbbx just need to figure out where to suppress the exception and the side effects of doing so.
Apologies for not linking to a project that has this issue. To reproduce, you'll want to set up a sphinx docs using get_outdated_docs and then build the docs. Here's one project that's using that setting. The rest of the settings can probably be left at the defaults. Let me know if that's not enough to reproduce the issue.
@jaraco I'm looking into this now and realized that I don't fully understand the request. Do you want the extension to pretend there's no news fragments and render the content as if nothing was returned? Or do you want a nicer error message?