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

fix: close file #61

Merged
merged 1 commit into from
Apr 20, 2024
Merged

fix: close file #61

merged 1 commit into from
Apr 20, 2024

Conversation

m9810223
Copy link
Contributor

@m9810223 m9810223 commented Apr 19, 2024

A fix to close files after writing.

@lukebakken
Copy link
Collaborator

Hello, thanks for your contribution. How did you determine that this change should be made?

@lukebakken lukebakken self-assigned this Apr 19, 2024
@m9810223
Copy link
Contributor Author

Hi @lukebakken!


In Python, file object has a close method.

To call the method, add () after the method, like xxx.close().

If you don't want to close the file, Python will close it when the program exits
And we don't need the line xxx.close.

https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files

@lukebakken lukebakken merged commit 2c14fb8 into rabbitmq:main Apr 20, 2024
15 checks passed
@lukebakken
Copy link
Collaborator

Thank you. I would have expected the current code to warn us that .close is not a real member, but, that's Python for you 🙄

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 this pull request may close these issues.

2 participants