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

set file to None on close for SequentialJsonlWriter #1039

Closed
csukuangfj opened this issue Apr 23, 2023 · 0 comments · Fixed by #1040
Closed

set file to None on close for SequentialJsonlWriter #1039

csukuangfj opened this issue Apr 23, 2023 · 0 comments · Fixed by #1040

Comments

@csukuangfj
Copy link
Contributor

def _maybe_open(self):
if self.file is None:
self.file = open_best(self.path, self.mode)
def close(self):
if self.file is not None:
self.file.close()

I think we should add

self.file = None

after

self.file.close()

so that _maybe_open() can work correctly.

pzelasko added a commit that referenced this issue Apr 24, 2023
@pzelasko pzelasko linked a pull request Apr 24, 2023 that will close this issue
pzelasko added a commit that referenced this issue Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant