Closed rysson closed 3 years ago
Hello!
After receiving your suggestion, I have read the official pathlib documentation these two days,
My conclusion is that pathlib
has fewer features than os.path
. So I'm not going to use pathlib
for long.
Also, the result of calling pathlib
does not conform to my habit of using os.path
. For example:
D:\>python
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> Path('../test/1.txt').resolve()
WindowsPath('D:/test/1.txt')
>>> Path('./test/1.txt').resolve() # Failed to convert to absolute path
WindowsPath('test/1.txt')
>>>
>>> import os
>>> os.path.abspath('./test/1.txt')
'D:\\test\\1.txt'
Finally, I recommend that you convert your pathlib.Path
to a normal string and then use:
p = pathlib.Path('1.jpg')
pyexiv2.Image(str(p))
Sure, I've used it in this way already.
os.path
works with pathlib
too (as well as with str
), so there should be no regression.
BTW. I started using pathlib
just a few month ago (after years of ignoring it). I understand and close the issue. Use str(path)
is not so difficult :-)
This issue has been automatically closed because there has been no activity for a month.
Path
forpathlib
is recommended and very nice way to handle system paths. Could you add support it inpyexiv2.Image
?