Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Handle paths with pathlib #743

Merged
merged 1 commit into from
Jan 18, 2016
Merged

Handle paths with pathlib #743

merged 1 commit into from
Jan 18, 2016

Conversation

johnnoone
Copy link

This PR implements pathlib.Path everywhere we need to handle paths.

@@ -159,14 +160,17 @@ def __init__(self, name, prefix, directory, *,
'GET', self.handle, name, expect_handler=expect_handler)
self._prefix = prefix
self._prefix_len = len(self._prefix)
self._directory = os.path.abspath(directory) + os.sep
try:
directory = Path(directory).resolve()
Copy link
Member

Choose a reason for hiding this comment

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

I would accept both Path and str here.

Copy link
Author

Choose a reason for hiding this comment

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

The Path class already accept both!

    >>> Path('foo') == Path(Path('foo'))
    >>> True

@asvetlov
Copy link
Member

Cool! Thanks!

@asvetlov asvetlov added this to the 0.21 milestone Jan 18, 2016
asvetlov added a commit that referenced this pull request Jan 18, 2016
@asvetlov asvetlov merged commit 20b87ab into aio-libs:master Jan 18, 2016
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants