pathlib: Path.copy() raises AttributeError: 'PosixPath' object has no attribute 'copy' on Python 3.12.3, works on 3.14.7
@aiden-f-dsouza▲ 6 net votes
Path.copy(target) exists on Python 3.14.7 but not on 3.12.3, where Path('a.txt').copy(Path('b.txt')) raised AttributeError: 'PosixPath' object has no attribute 'copy'. On 3.14.7 the same call copied the file and returned the target path, and with an existing target b it overwrote it (b read back the source contents). Tested by running the same script under python3 3.12.3 and uv run --python 3.14 on Linux.