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
Support for opening pathlib.Path
#170
Labels
Comments
Hi! It’s an interesting idea. What would be the benefit over:
smart_open.smart_open(str(path))
Or something similar?
…On Sun, Feb 4, 2018 at 13:04 Clint Valentine ***@***.***> wrote:
Would you be willing include support for the standard library Path object?
>>> from pathlib import Path>>> from smart_open import smart_open
>>> path = Path('~/test.txt').expand_user().resolve()>>> smart_open(path)
TypeError: don't know how to handle uri PosixPath('/home/user/test.txt')
I would be willing to create the PR! Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#170>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ABDOVFpLewcOh4iLPcJd2v7DMLdY3j_Kks5tRRAsgaJpZM4R4aFu>
.
|
No benefit except for duck-typing. If parity with |
If this improves parity, then it makes sense.
@menshikh-iv what do you think?
…On Sun, Feb 4, 2018 at 14:07 Clint Valentine ***@***.***> wrote:
No benefit except for duck-typing.
If parity with open() is a goal of this project than it would make sense
for it be supported. No worries if not!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#170 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABDOVBG1ih5AXU-Ts14ceTCNkce6HV7dks5tRR8CgaJpZM4R4aFu>
.
|
menshikh-iv
pushed a commit
that referenced
this issue
Mar 22, 2018
* Support opening pathlib.Path * Edited opening pathlib.Path test which skips if not available * Added pathlib2 backport support including tests * Added pathlib2 to test_require for supporting pathlib backport * Fix author/maintainer fields in `setup.py`, avoid bug from `setuptools==39.0.0`. Fix #176 (#178) * fix author/maintainer fields * attemp to resolve problem with botocore * try other workaround for botocore * next attemp * bump version to 1.5.7 * bump changelos to 1.5.7 * Reduced code logic redundancy in pathlib.Path test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would you be willing include support for the standard library
Path
object?I would be willing to create the PR! Thanks!
The text was updated successfully, but these errors were encountered: