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

specify mode for gzipfile (for python 3.9 compatibility) #1031

Closed
terriko opened this issue Jan 20, 2021 · 4 comments
Closed

specify mode for gzipfile (for python 3.9 compatibility) #1031

terriko opened this issue Jan 20, 2021 · 4 comments
Labels
good first issue Good for newcomers

Comments

@terriko
Copy link
Contributor

terriko commented Jan 20, 2021

In #910, @chazuttu noted the following:

Python 3.9 is the last version providing backward compatibility layers. 
Opening GzipFile file for writing without specifying the mode argument is deprecated

We should fix this by specifying the mode argument. You can read about the arguments in the documentation here:
https://docs.python.org/3/library/gzip.html

Without even looking at the code, my guess is that we want a mode of "rb" (read-only binary) where gzip is used, as we don't generally write to gzip files in cve-bin-tool.

@terriko terriko added the good first issue Good for newcomers label Jan 20, 2021
@terriko terriko changed the title specify mode for gzipfile specify mode for gzipfile (for python 3.9 compatibility) Jan 20, 2021
@jerinjtitus
Copy link
Contributor

I looked into this and I think it's already being accounted for. The mode is already specified everywhere.
If I am wrong, then please correct me

@terriko
Copy link
Contributor Author

terriko commented Jan 25, 2021

Hm. it's possible that it's been fixed since it was reported. Do all the gzipfile tests run correctly on python 3.9, now?

@chazuttu
Copy link

The mode for gzipfile can be of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x' or 'xb' for binary mode, or 'rt', 'at', 'wt', or 'xt' for text mode. The default is 'rb'.So I think its resolved.
U may close this issue

@terriko
Copy link
Contributor Author

terriko commented Feb 10, 2021

Thanks for double-checking for me!

@terriko terriko closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants