Skip to content
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

snakemake.io._IOFile.open method doesn't use it's keyword arguments #2846

Closed
J-Wall opened this issue Apr 26, 2024 · 0 comments · Fixed by #2847
Closed

snakemake.io._IOFile.open method doesn't use it's keyword arguments #2846

J-Wall opened this issue Apr 26, 2024 · 0 comments · Fixed by #2847
Labels
bug Something isn't working

Comments

@J-Wall
Copy link
Contributor

J-Wall commented Apr 26, 2024

Snakemake version
Checked this issue is in the master branch

Describe the bug

I am trying to open a file (output of a checkpoint rule) using the .open() method while specifying the mode. However, it just gets opened in text mode which leads to an error downstream in my code.

I had a look at the code in the master branch, and the method has call signature

def open(self, mode="r", buffering=-1, encoding=None, errors=None, newline=None):

however, in the body of the function it just calls

f = open(self)

I think this should instead be

f = open(self, mode=mode, buffering=buffering, encoding=encoding, errors=errors, newline=newline)
@J-Wall J-Wall added the bug Something isn't working label Apr 26, 2024
J-Wall added a commit to J-Wall/snakemake that referenced this issue Apr 26, 2024
johanneskoester added a commit that referenced this issue Apr 29, 2024
fixes #2846

Previously, keword arguments to `.open` were not actually used leading
to unexpected (by me) behaviour. I don't think the documentation needs
to change to reflect this, because it's what one would expect in the
first place.

### QC
<!-- Make sure that you can tick the boxes below. -->

* [ ] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).

---------

Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant