summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-12-16 14:05:48 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-12-16 21:04:35 -0500
commitf5905a012ed539286f33b10559b832da7babe1c5 (patch)
tree5e6e2d6726d636b3cb25002688ec47b040e06ccb
parent84ba8874e146bcdbf46ce70ece32c4c224c3fd44 (diff)
downloadsqlalchemy-f5905a012ed539286f33b10559b832da7babe1c5.tar.gz
dont call platform.architecture()
Fixed regression where the base compat module was calling upon ``platform.architecture()`` in order to detect some system properties, which results in an over-broad system call against the system-level ``file`` call that is unavailable under some circumstances, including within some secure environment configurations. Fixes: #8995 Change-Id: Ib6171e75aff5a60a79dab81a0be21bee2456318b (cherry picked from commit e852362bfdf9a18dfd91137f4a2d7c2dfee30082)
-rw-r--r--doc/build/changelog/unreleased_14/8995.rst9
-rw-r--r--lib/sqlalchemy/util/compat.py2
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/build/changelog/unreleased_14/8995.rst b/doc/build/changelog/unreleased_14/8995.rst
new file mode 100644
index 000000000..5191b58de
--- /dev/null
+++ b/doc/build/changelog/unreleased_14/8995.rst
@@ -0,0 +1,9 @@
+.. change::
+ :tags: bug, installation
+ :tickets: 8995
+
+ Fixed regression where the base compat module was calling upon
+ ``platform.architecture()`` in order to detect some system properties,
+ which results in an over-broad system call against the system-level
+ ``file`` call that is unavailable under some circumstances, including
+ within some secure environment configurations.
diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py
index 2b5a2c0ef..460d7161c 100644
--- a/lib/sqlalchemy/util/compat.py
+++ b/lib/sqlalchemy/util/compat.py
@@ -29,7 +29,7 @@ cpython = platform.python_implementation() == "CPython"
win32 = sys.platform.startswith("win")
osx = sys.platform.startswith("darwin")
arm = "aarch" in platform.machine().lower()
-is64bit = platform.architecture()[0] == "64bit"
+is64bit = sys.maxsize > 2 ** 32
has_refcount_gc = bool(cpython)