python-decouple
python-decouple copied to clipboard
_caller_path() may not act the way it's supposed to
According to my test, the method _caller_path()
just return name of the executed file, but not the full path. Thus, os.path.dirname(file_name)
will always return an empty string ''
. Although with os.path.abspath('')
we will always get the current directory correctly, the method _caller_path()
seems redundant and can be removed.
Then, __init__(self, search_path=None):
can be modified into __init__(self, search_path=''):
. And self._load(self.search_path or self._caller_path())
will be simply self._load(self.search_path)
. My test on this modification works well so far.
Very interesting. Can you provide a PR?
May I assign this issue?