-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
boto3 unable to read __file__ attribute when loaded from an egg #1008
Comments
I don't think this will be a simple change. I would really rather not pull in any dependencies if at all possible, but it seems like the relevant pkgutil method |
The way we currently load data depends on things like checking
The only way to do (1) in a backwards compatible way is to support both the current way and the hypothetical new way. If we're going to make a change this is likely to be the most robust (but also the most invasive). Doing (2) should be pretty straight forward I believe, but depending on (3) is where we're at now, although add a zip_safe=False to the setup kwargs might help? |
Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it. |
#2191 sounds like another variation of this. |
We are running boto3 by appending all required eggs to
PYTHONPATH
. However, when we callsession.get_available_resources()
it returns[]
. Through a bit of debug, we realized that the JSON service files were not being read in from the<BOTOCORE_ROOT>/data
directory. We actually were getting a NotADirectoryError when directly callingos.listdir(<BOTOCORE_ROOT>/data)
.This is because
BOTOCORE_ROOT
is initialized by reading in__file__
and according to this site,In order to support compressed installation, it is suggested to use
pkg_resources.resource_filename()
instead of__file__
.This seems to be an issue that other people have also run into ( #332 #308) and was hoping it could be patched in a future version. Or, I would love to know some alternative solution to getting an s3 resource from a boto3 session.
The text was updated successfully, but these errors were encountered: