mirror of
https://github.com/borgbackup/borg.git
synced 2026-02-19 02:29:19 -05:00
cleanup: remove check_python() compatibility shim
The check_python() function verified that the Python runtime supported 'follow_symlinks' for os.stat, os.utime, and os.chown. This check is no longer necessary because: 1. Borg now requires Python >= 3.10. 2. On POSIX systems (Linux, macOS, *BSD, Haiku, OmniOS), support for these operations relies on the *at syscalls (fstatat, etc.), which have been implemented in standard libc for well over a decade (e.g., FreeBSD 8.0+, NetBSD 6.0+, Solaris 11+). 3. On Windows (MSYS2/MinGW), Python has supported follow_symlinks for os.stat since Python 3.2. The removed check specifically inspected only os.stat on Windows, avoiding the problematic os.utime/os.chown checks. Any platform capable of running Python 3.10 will inherently support these standard file operations.
This commit is contained in:
parent
40dcfe4d99
commit
013edcd558
3 changed files with 3 additions and 17 deletions
|
|
@ -40,7 +40,7 @@ try:
|
|||
from ..helpers import format_file_size
|
||||
from ..helpers import remove_surrogates, text_to_json
|
||||
from ..helpers import DatetimeWrapper, replace_placeholders
|
||||
from ..helpers import check_python, check_extension_modules
|
||||
from ..helpers import check_extension_modules
|
||||
from ..helpers import is_slow_msgpack, is_supported_msgpack, sysinfo
|
||||
from ..helpers import signal_handler, raising_signal_handler, SigHup, SigTerm
|
||||
from ..helpers import ErrorIgnoringTextIOWrapper
|
||||
|
|
@ -455,9 +455,7 @@ class Archiver(
|
|||
return args
|
||||
|
||||
def prerun_checks(self, logger, is_serve):
|
||||
if not is_serve:
|
||||
# this is the borg *client*, we need to check the python:
|
||||
check_python()
|
||||
|
||||
check_extension_modules()
|
||||
selftest(logger)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import logging
|
|||
from collections import namedtuple
|
||||
|
||||
from ..constants import * # NOQA
|
||||
from .checks import check_extension_modules, check_python
|
||||
from .checks import check_extension_modules
|
||||
from .datastruct import StableDict, Buffer, EfficientCollectionQueue
|
||||
from .errors import Error, ErrorWithTraceback, IntegrityError, DecompressionError, CancelledByUser, CommandError
|
||||
from .errors import RTError, modern_ec
|
||||
|
|
|
|||
|
|
@ -1,16 +1,4 @@
|
|||
import os
|
||||
|
||||
from .errors import RTError
|
||||
from ..platformflags import is_win32
|
||||
|
||||
|
||||
def check_python():
|
||||
if is_win32:
|
||||
required_funcs = {os.stat}
|
||||
else:
|
||||
required_funcs = {os.stat, os.utime, os.chown}
|
||||
if not os.supports_follow_symlinks.issuperset(required_funcs):
|
||||
raise RTError("""FATAL: This Python was compiled for a too old (g)libc and lacks required functionality.""")
|
||||
|
||||
|
||||
def check_extension_modules():
|
||||
|
|
|
|||
Loading…
Reference in a new issue