python-decouple icon indicating copy to clipboard operation
python-decouple copied to clipboard

_caller_path() may not act the way it's supposed to

Open davidchern opened this issue 3 years ago • 2 comments

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.

davidchern avatar Nov 25 '21 10:11 davidchern

Very interesting. Can you provide a PR?

henriquebastos avatar Feb 02 '22 19:02 henriquebastos

May I assign this issue?

kvngho avatar Sep 01 '23 02:09 kvngho