GH-73991: Support copying directory symlinks on older Windows (#120807)

Check for `ERROR_INVALID_PARAMETER` when calling `_winapi.CopyFile2()` and
raise `UnsupportedOperation`. In `Path.copy()`, handle this exception and
fall back to the `PathBase.copy()` implementation.
This commit is contained in:
Barney Gale 2024-07-03 04:30:29 +01:00 committed by GitHub
parent 089835469d
commit f09d184821
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 40 additions and 29 deletions

View file

@ -5,7 +5,8 @@ import errno
import stat
import unittest
from pathlib._abc import UnsupportedOperation, ParserBase, PurePathBase, PathBase
from pathlib._os import UnsupportedOperation
from pathlib._abc import ParserBase, PurePathBase, PathBase
import posixpath
from test.support import is_wasi