sphinx-contrib / sphinxcontrib-towncrier

An RST directive for injecting a Towncrier-generated changelog draft containing fragments for the unreleased (next) project version. Demo: https://ansible-pylibssh.rtfd.io/changelog. Docs: https://sphinxcontrib-towncrier.rtfd.io
https://pypi.org/p/sphinxcontrib-towncrier
BSD 3-Clause "New" or "Revised" License
19 stars 18 forks source link

Error in get_outdated_docs when directory is not specified #83

Open jaraco opened 1 year ago

jaraco commented 1 year ago

Towncrier uses the directory newsfragments by default. However, if directory is not defined in the towncrier config, this plugin will fail with the following error:

Extension error (sphinxcontrib.towncrier.ext):
Handler <bound method TowncrierDraftEntriesEnvironmentCollector.get_outdated_docs of <sphinxcontrib.towncrier.ext.TowncrierDraftEntriesEnvironmentCollector object at 0x107773750>> for event 'env-get-outdated' threw an exception (exception: unsupported operand type(s) for /: 'PosixPath' and 'NoneType')

Adding directory = "newsfragments" to the config works around the error.

This extension should support the same defaults as towncrier.