minstall: fix symlink handling on python 3.13

We passed a wrapper hack for shutil.chown because some functionality
wasn't available in the stdlib. It was added in python 3.13 beta1, so
the tests fail when we actually test symlink handling.

Fixes failure to run test_install_subdir_symlinks_with_default_umask_and_mode
on python 3.13.
pull/13205/head
Eli Schwartz 12 months ago
parent eba5498e9b
commit 8fe8b1d829
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 6
      mesonbuild/minstall.py

@ -148,6 +148,12 @@ def set_chown(path: str, user: T.Union[str, int, None] = None,
# be actually passed properly. # be actually passed properly.
# Not nice, but better than actually rewriting shutil.chown until # Not nice, but better than actually rewriting shutil.chown until
# this python bug is fixed: https://bugs.python.org/issue18108 # this python bug is fixed: https://bugs.python.org/issue18108
if sys.version_info >= (3, 13):
# pylint: disable=unexpected-keyword-arg
# cannot handle sys.version_info, https://github.com/pylint-dev/pylint/issues/9138
shutil.chown(path, user, group, dir_fd=dir_fd, follow_symlinks=follow_symlinks)
else:
real_os_chown = os.chown real_os_chown = os.chown
def chown(path: T.Union[int, str, 'os.PathLike[str]', bytes, 'os.PathLike[bytes]'], def chown(path: T.Union[int, str, 'os.PathLike[str]', bytes, 'os.PathLike[bytes]'],

Loading…
Cancel
Save