Closed jaraco closed 2 months ago
Oh, this change fails on Python 3.9 and earlier due to the newline
parameter only being added in that edition.
If this proposed transition is acceptable, I'd be tempted to wrap the offending call in a compatibility wrapper (something that would signal its removal after Python 3.9 support is dropped), but I'm not sure it's worth the effort.
The coverage failure doesn't make any sense:
Name Stmts Miss Branch BrPart Cover Missing
----------------------------------------------------------------------
src/towncrier/_writer.py 25 0 10 1 97% 20->exit
----------------------------------------------------------------------
TOTAL 677 0 321 1 99%
Does 20->exit
mean that the coverage check wants to see an exception occur in the context in order to check both __exit__(None, None, None)
and __exit__(type, val, ctx)
? That's absurd and didn't need to be checked before. Or is it a bug in coverage, where it's failing to detect that the context is exited at all (which it must for the function to return)?
Thanks. If you are happy with this PR, feel free to merge.
Thanks. If you are happy with this PR, feel free to merge.
I would merge, but something's wrong with credentials. I'm a member of towncrier-contributors, yet I have no option to merge. I've signed out and back in but yet can't merge. It says I need write access to merge.
Sorry. My bad. I set the wrong permissiosn for the team. I have merged it, but in the future you should be able to merge. Thanks again!
Description
While working on #577, I noticed it might be nice to leverage pathlib for reading and writing files. This approach avoids adding nesting and with blocks by utilizing
read_text
andwrite_text
.This PR depends on #577 and should be rebased after merging that one.
Checklist
src/towncrier/newsfragments/
. Describe your change and include important information. Your change will be included in the public release notes.docs/tutorial.rst
is still up-to-date.docs/cli.rst
reflects those changes.docs/configuration.rst
reflects those changes.