-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer pathlib for read/write operations #591
Conversation
b6258b0
to
f013fba
Compare
Oh, this change fails on Python 3.9 and earlier due to the 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. |
3acbaf3
to
e5c6df7
Compare
The coverage failure doesn't make any sense:
Does |
01dc868
to
cb8076b
Compare
cb8076b
to
163c42d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Happy to use pathlib.
I left a few minor comments.
I don't line universal newlines.
On my projects, we always use \n
for the source code.
You don't want a source file created on Windows to conflict with Linux.
So I think towncrier should just auto-detect the newlines used in the "filename" configuration and use that for "create" and other cases.
Thanks. If you are happy with this PR, feel free 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 yourchange 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.