]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
dont call platform.architecture()
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 16 Dec 2022 19:05:48 +0000 (14:05 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 16 Dec 2022 19:05:48 +0000 (14:05 -0500)
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

doc/build/changelog/unreleased_14/8995.rst [new file with mode: 0644]
lib/sqlalchemy/util/compat.py

diff --git a/doc/build/changelog/unreleased_14/8995.rst b/doc/build/changelog/unreleased_14/8995.rst
new file mode 100644 (file)
index 0000000..5191b58
--- /dev/null
@@ -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.
index 6517e381cb7679fad1b2de8e6f82eec2ac6f7eb0..0f212fad52627ae4716e56d3046739209761f33f 100644 (file)
@@ -41,7 +41,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)