-
Notifications
You must be signed in to change notification settings - Fork 208
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
Allow verdi calcjob outputcat
work with binary files
#4077
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4077 +/- ##
===========================================
+ Coverage 78.76% 78.78% +0.02%
===========================================
Files 463 463
Lines 34402 34414 +12
===========================================
+ Hits 27095 27108 +13
+ Misses 7307 7306 -1
Continue to review full report at Codecov.
|
Now just open the file as it is in bytes. Use copyfileobj to do the copying in chunks and avoid high memory usage.
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.
Some minor comments
BTW, since you are at it, probably you might want to:
|
@giovannipizzi Done! I have also added the tests. |
Looking good @zhubonan , thanks a lot. There is also |
@sphuber i thinks that has been fixed as well in the latest pushes (please do double check). It is really to merge now. |
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 @zhubonan
Fixes #4086
This PR allows
verdi calcjob outputcat
to work with binary files such as those compressed bygzip
. Previously, only plain text files can be printed because of the missing parametermode
inget_object_content
, which defaults tor
.Edit:
Now just open the file as it is in bytes, and use
shutil.copyfileobj
to do the copying. This function copies the content in chunks and avoids high memory usage. The command should now work with both text files and binary data.