Skip to content
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

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

Open
davidchern opened this issue Nov 25, 2021 · 2 comments
Open

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

davidchern opened this issue Nov 25, 2021 · 2 comments

Comments

@davidchern
Copy link

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.

@henriquebastos
Copy link
Collaborator

Very interesting. Can you provide a PR?

@kvngho
Copy link

kvngho commented Sep 1, 2023

May I assign this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants