-
Notifications
You must be signed in to change notification settings - Fork 88
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
Handle other pathlib.Path.open calls in read_text, read_bytes, write_text and write_bytes #1022
Conversation
…text and write_bytes
self.skip_names, | ||
self._path(), | ||
mode="rb", | ||
) as f: | ||
return f.read() |
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.
Ah, thanks - I was thinking about this and completely forgot it!
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.
I'm glad I could contribute!
Can you kindly take care of the release notes? I'm not sure about the release date.
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 a lot!
Ah, there is no entry after the release yet. Just put ## Unreleased
on top instead of a release description, no release date is needed - that will only be added at release time. And pytype
is still failing... it can be a bit finicky.
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.
Let me know if I shall handle the pytype
errors myself.
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.
I'm adding __enter__
and __exit__
to some classes like FakeDirWrapper
, I'm following the patterns in FakePipeWrapper
.
If it needs to be handled differently, I'd be thankful if you take care of it yourself.
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.
Does read
have a meaning for FakeDirWrapper
?
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.
I think this is the correct way to handle this, thanks!
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.
I tried to add read
and write
methods in a meaningful way, as far as I could understand the semantics. The tests are now passing and I added the release entry, please review my changes when you got the time.
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.
This looks all fine, thank you! I'll wait with the merge until you remove the [WIP].
I removed [WIP]. |
Describe the changes
The related issue or a description of the bug or feature that this PR addresses.
Tasks