[Bug 1604147] Re: pathlib.Path.path attribute has disappeared
Barry Warsaw
1604147 at bugs.launchpad.net
Mon Jul 18 21:03:27 UTC 2016
It's confusing, but this isn't a bug.
As you mention, pathlib.Path.path isn't documented, and there's a reason
for that. In Python 3.5, pathlib is still technically a provisional
API, which you can see mentioned in the doc page. That means that the
API can change in backward incompatible ways, which you've seen here.
The .path attribute was an attempt at making pathlib objects more
compatible with other APIs that require paths-as-strings, but it really
didn't work very well. There was extensive discussion on various
mailing lists about how to go forward and the outcome of that was PEP
519:
https://www.python.org/dev/peps/pep-0519/
So in Python 3.6 there will be a blessed protocol for interoperability
between pathlib paths and str paths, but this is not backported to 3.5.
PEP 519 also says:
"""
The path attribute will be removed as this PEP makes it redundant (it has not been included in any released version of Python and so is not a backwards-compatibility concern).
"""
Technically true, but I suspect because Matthias uploads inter-release
snapshots, you got caught in the small window where the attribute
existed between the 3.5.1 and 3.5.2 releases, and before it got removed
upstream.
Until 3.6 is available, str(path) is your best workaround.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3.5 in Ubuntu.
https://bugs.launchpad.net/bugs/1604147
Title:
pathlib.Path.path attribute has disappeared
Status in python3.5 package in Ubuntu:
Invalid
Bug description:
Previously pathlib.Path("/some/path").path would result in the same as
str(pathlib.Path("/some/path")). Today's update to Python 3.5.2 in
Xenial appears to have removed this property. It's easy enough to work
around, but Path.path was a public API, albeit not one documented at
https://docs.python.org/3/library/pathlib.html.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: python3.5 3.5.2-2~16.01
ProcVersionSignature: Ubuntu 4.4.0-31.50-generic 4.4.13
Uname: Linux 4.4.0-31-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Jul 18 21:30:43 2016
InstallationDate: Installed on 2014-03-16 (854 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20140316)
SourcePackage: python3.5
UpgradeStatus: Upgraded to xenial on 2015-11-22 (238 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3.5/+bug/1604147/+subscriptions
More information about the foundations-bugs
mailing list