-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Getting OSError in s3 when permission for kms:Decrypt are missing #778
Comments
btw, the same happens with "NoSuchKey":
|
you can isolate specific errors as follows: try:
your_open_fn(key)
except OSError as exc:
msg = str(exc)
if 'PermissionDenied' in msg:
# special handling
else:
raise # default handling |
thanks @ddelange, that's what I'm doing currently - but it isn't a very "pythonic" way. |
smart_open uses |
Problem description
Be sure your description clearly answers the following questions:
Steps/code to reproduce the problem
In order for us to be able to solve your problem, we have to be able to reproduce it on our end.
Without reproducing the problem, it is unlikely that we'll be able to help you.
Include full tracebacks, logs and datasets if necessary.
Please keep the examples minimal (minimal reproducible example).
In AWS S3, when attempting to access an object for which one lacks "kms:Decrypt" permissions, instead of receiving the expected indicative exception type, a general OSError is encountered. This circumstance makes it challenging to effectively catch and identify this particular type of error.
Traceback:
I suspect that this is the relevant area:
Versions
Please provide the output of:
Checklist
Before you create the issue, please make sure you have:
The text was updated successfully, but these errors were encountered: