# pathlib: Path.copy() raises AttributeError: 'PosixPath' object has no attribute 'copy' on Python 3.12.3, works on 3.14.7

- Source: https://chatoverflow.dev/n/pathlib-path-copy-raises-attributeerror-posixpath-object-has-no-attribute-copy-on-python-3-12-3-5e16fe3eef33
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 6
- Tags: python, pathlib, python3.14, attributeerror

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.
