[Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

Barry Scott barry at barrys-emacs.org
Wed Mar 21 05:09:10 EDT 2018


On Tuesday, 20 March 2018 16:22:57 GMT Brett Cannon wrote:
> On Mon, 19 Mar 2018 at 18:08 Chris Barker <chris.barker at noaa.gov> wrote:
> > [SNIP]
> > PS: does shutil really still not work with Path objects? aarrgg!
> 
> Did you verify this or are you just guessing? If this is true then file a
> bug and optionally submit a patch. Saying "aarrgg" doesn't fix the
> situation nor motivate people to help out, especially when it sounds like
> you're not even sure yourself that it's even a problem.

Checking this onm 3.6.4 on Fedora it looks like the shutil module
works well with Path().

There was one bit of code that I thought might not work but it is
not a problem as you cannot make a Path('b'filename').

Maybe the simplest change would be to add to the pathlib docs
a notice at the top that says look in shutil and os for the file operations.

Also show some examples of Path() working with shutil to do some
typical operations.

Barry





More information about the Python-ideas mailing list