sphinxcontrib-towncrier icon indicating copy to clipboard operation
sphinxcontrib-towncrier copied to clipboard

Error in get_outdated_docs when framents dir missing

Open jaraco opened this issue 2 years ago • 4 comments

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.

jaraco avatar Jun 21 '23 12:06 jaraco

Fair enough. This needs to be fixed.

webknjaz avatar Jun 21 '23 14:06 webknjaz

Hey there, I'm intersted in contributing to this issue do let me know how I can help

adkbbx avatar Sep 26 '23 13:09 adkbbx

@adkbbx just need to figure out where to suppress the exception and the side effects of doing so.

webknjaz avatar Oct 25 '23 13:10 webknjaz

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 avatar Oct 25 '23 15:10 jaraco

@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?

webknjaz avatar Feb 25 '25 19:02 webknjaz