[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-15 Thread Brett Cannon
Brett Cannon added the comment: I should also mention that rename() (https://docs.python.org/3/library/pathlib.html#pathlib.Path.rename) and replace() (https://docs.python.org/3/library/pathlib.html#pathlib.Path.replace) already do exist, so it might be best to add a keyword-only flag to one

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-15 Thread Brett Cannon
Brett Cannon added the comment: I also support the idea of getting something like shutil.move() into pathlib. -- ___ Python tracker ___

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-14 Thread Eric V. Smith
Eric V. Smith added the comment: I agree this needs to be different from replace(), due to not being atomic. That makes it an enhancement, so I'm removing 3.5. I'm +1 on Path supporting something like shutil.move(). -- nosy: +eric.smith type: -> enhancement versions: -Python 3.5

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-13 Thread Eryk Sun
Eryk Sun added the comment: Moving a file across volumes isn't atomic. Getting an exception in this case can be useful. There could be a "strict" keyword-only parameter that defaults to False. If it's true, then replace() won't try to move the file. -- nosy: +eryksun

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-13 Thread Laurent Mazuel
Laurent Mazuel added the comment: Just to confirm, I was able to workaround it with Py3.6: # client_generated_path.replace(destination_folder) shutil.move(client_generated_path, destination_folder) It is reasonable to think about adding a similar feature to pathlib if it doesn't

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-13 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-13 Thread Brett Cannon
Changes by Brett Cannon : -- components: +Library (Lib) -IO ___ Python tracker ___ ___

[issue29805] Pathlib.replace cannot move file to a different drive on Windows if filename different

2017-03-13 Thread Laurent Mazuel
New submission from Laurent Mazuel: Trying to use Pathlib and Path.replace on Windows if drive are different leads to an issue: File "D:\myscript.py", line 184, in update client_generated_path.replace(destination_folder) File "c:\program files (x86)\python35-32\Lib\pathlib.py", line