-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add read file in bytes using fileb:// #1010
Conversation
try: | ||
LOG.debug('Unpacked value of "%s" for parameter "%s": %s', | ||
value, self.py_name, unpacked) | ||
except UnicodeDecodeError: |
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.
Could we just use %r always? I think we if we remove the quotes from the "%s" it should look almost the same.
'Unpacked value of %r for param %s: %r'
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.
I would be good with changing that as it would mean less code to maintain. I only originally had it in there to avoid the least amount of change in behavior. Yet again if anything changes in the debug output, it should be minimal because we would only be using repr()
instead of str()
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.
Yeah I'd test to make sure, but I think just using %r always would be easier to maintain. It's a debug log anyways so we're free to alter the messages and the formatting.
I believe one of the test failures will be fixed once boto/botocore#383 is merged, but it looks like there's another test failure as well where we aren't checking the file contents as bytes:
https://travis-ci.org/aws/aws-cli/jobs/41430653#L576 Otherwise looks good. |
Looks good. |
Add read file in bytes using fileb://
Thanks Kyle. 👍 |
Fixes #814, #815
If you want to read the file as binary, simply prepend file name with
fileb://
instead offile://
cc @jamesls @danielgtaylor