D6258: packaging: coerce paths to strings

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Apr 17 14:44:11 EDT 2019


durin42 added a comment.


  In https://phab.mercurial-scm.org/D6258#91056, @indygreg wrote:
  
  > In https://phab.mercurial-scm.org/D6258#91055, @durin42 wrote:
  >
  > > Argh. This change appears to be wrong (!) so I'm going to drop it.
  >
  >
  > Eh? I don't see anything wrong with this. Casting a `pathlib.Path` to `str` should just work! In fact, it is necessary for older Python 3, as there was a long tail of stdlib functions that didn't accept `pathlib.*` when those types were first introduced. I believe 3.7 was the first release that fixed them all.
  
  
  At least one of the archive libraries can't cope with a destination being a Path but a source being a str, or something like that. zipfile can't (AFAICT) cope with Path objects on Python 3.5, but I worked around that by finding a Windows image at work that came with 3.7 already installed. :)

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6258

To: durin42, #hg-reviewers, pulkit
Cc: indygreg, mercurial-devel


More information about the Mercurial-devel mailing list