This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Antony.Lee
Recipients Antony.Lee
Date 2016-06-01.09:18:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, pickling Path objects lead to issues when working across platforms: Paths (and, thus, objects that contain Paths) created on a POSIX platform (PosixPaths) cannot be unpickled on Windows and vice versa.  There are a few possibilities around this issue.

- Don't do anything about it, you should use PurePaths if you care about cross-platform compatibility: this would be pretty awkward, as any call to the Path API would require converting back the PurePath to a Path first.

- Silently convert Paths to PurePaths during pickling (a solution that seems to have been adopted by http://docs.menpo.org/en/stable/api/menpo/io/export_pickle.html for example): it would be better if Paths at least roundtripped correctly within a single platform.

- Convert Paths to PurePaths at unpickling time, only if the platform is different (and possibly with a warning): this is the least bad solution I came up with so far.  Note that calls to the Path API on a "converted" PurePath object would be invalid anyways as the PurePath (being of a different platform) cannot be representing a valid path.

Thoughts?
History
Date User Action Args
2016-06-01 09:18:05Antony.Leesetrecipients: + Antony.Lee
2016-06-01 09:18:04Antony.Leesetmessageid: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za>
2016-06-01 09:18:04Antony.Leelinkissue27175 messages
2016-06-01 09:18:04Antony.Leecreate