-
-
Notifications
You must be signed in to change notification settings - Fork 955
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
Swap unipath with pathlib #356
Conversation
I'm pretty sure there are more of those hidden in the docs views |
Thanks, I'll fix the rest later today |
I updated it now. The docs site and |
|
||
# Utilities | ||
|
||
# The full path to the repository root. | ||
BASE = Path(__file__).absolute().ancestor(2) | ||
BASE = Path(__file__).resolve().parents[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using Path(__file__).resolve().parent
would be nicer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs to be Path(__file__).resolve().parent.parent
, since Path.parent
is the same as Path.parents[0]
. Do you still think it is nicer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah. That's still nicer I think, since it's clearer.
This is awesome work @relekang, thank you! I've commented a bit above with general directions we should take here |
One thing that made me always wonder about pathlib is what makes Unipath not require the |
It's probably because AbstractPath in unipath inherits from |
I have removed the operator usage and updated it to use parent instead of parents |
Is this branch meant to be compatible with both Python 2 and 3? |
Yes, that was the thought :) |
This is related to issue django#343. Unipath has broken python 3 support.
I'm a bit confused on the added |
You are right, I did write it for python 3 and tested if it works on python 2 as well and did not think it through. It works since all the places it is used takes unicode or bytes on python 2. I can close this and make it a part of a python 3 pull-request or should I use |
Let's make a Python 3 pull request. I have time to do some manual testing tomorrow as well as update the server deployment, so let's see if we can get this finished off in the next couple days. |
This is related to issue #343. Unipath has broken python 3 support.