eliminate use of __file__ in boto3.session#4445
Conversation
|
Hi @zsol, Apologies this has been lingering for a bit. I was going back through open PRs to find uses/issues about #4528 and boto/botocore#3464 take a slightly different approach to address this. Do you have any concerns with those or other issues we might be missing for your use case? |
|
Hmm I'm not entirely sure that str(files(...)) will always give you a path that's on disk |
|
Do you happen to have any specific use cases you were seeing variance in? From some quick testing, we weren't able to find any difference between the old and new paths being produced. I'm sure there are some edge cases we're missing though. Or perhaps if you could point out why |
|
Sorry I meant to provide an example but it's proving to be a bit tricky to come up with something short :) The problem is that |
Python doesn't guarantee that the
__file__global is a string pointing to the name of the Python file hosting the source code of the current module, and certain Python environments (like PyOxidizer) indeed don't set it.This PR makes
boto3.session.Sessionstill work in these environments.