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

Updated the path for the jar libraries. Fixes issue #41. #53

Closed

Conversation

dmavroeidis
Copy link

@FraBle Please have a look at this fix for issue #41. I think that this is the most appropriate place for the fix, but please share your thoughts.

sutime/sutime.py Outdated
@@ -89,8 +89,8 @@ def __init__(
self._is_loaded = False
self._sutime = None
self._lock = threading.Lock()
module_root = Path(__file__).resolve().parent
self.jars = Path(jars) if jars else module_root / 'jars'
self.jars = Path(jars) if jars else os.path.join(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're mixing os.path and pathlib.
It should be

Path(jars) if jars else Path(importlib.util.find_spec('sutime').origin).parent / 'jars'

Does Path(__file__).resolve().parent not resolve correctly to the module root for you?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I don't have any issue with pathlib. I just find os.path more flexible. I corrected it now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't mean pathlib vs os.path. I'm just wondering whether the original logic didn't work for you and why :/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, read too fast... The original code resolves to the working folder, not the environment's library folder. I came accross this issue both on a Mac running Catalina and Ubuntu 18. I am using anaconda as the environment manager on both, so this could be the culprit.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, it should not resolve to the working folder, but rather the module itself (Path(__file__) should resolve to the python file in the module folder). I saw that you closed the PR. Did you find the root cause for your issue?

Copy link
Author

@dmavroeidis dmavroeidis Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I finally ended up not using this module, because it was much slower than datefinder - for instance. I would prefer it because it provides much more detail, but speed is an issue. The original issue (#41) still remains in my configuration (Mac with Conda). The module only works with the fix I suggested. I see that many people report the same issue, so I think it -at least- needs to be investigated. Let me know whether you want me to reopen the pull request once you have investigated or add the fix yourself. Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work btw making this API!

@codeclimate
Copy link

codeclimate bot commented Jan 26, 2021

Code Climate has analyzed commit a9d0812 and detected 0 issues on this pull request.

View more on Code Climate.

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

Successfully merging this pull request may close these issues.

2 participants