From 6a94f23251de1032831c1a40fb8f703bca389fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Tue, 27 Oct 2026 09:23:47 +0100 Subject: [PATCH] Update related to the #6161 --- lib/core/common.py | 26 +++++++++++++++++++------- lib/core/settings.py | 2 +- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 4b93d3ffd..477498853 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -4108,18 +4108,30 @@ def getDaysFromLastUpdate(): return int(time.time() - os.path.getmtime(paths.SQLMAP_SETTINGS_PATH)) // (3600 * 24) -def jitEnabled(): +def pythonBuildInfo(): """ - Returns True if the experimental JIT compiler is active (Python >= 3.13) + Returns markers of non-default interpreter builds/modes (e.g. free-threading, JIT) - >>> jitEnabled() in (True, False) + >>> isinstance(pythonBuildInfo(), str) True """ + retVal = [] + try: - return bool(sys._jit.is_enabled()) + if not sys._is_gil_enabled(): # Note: free-threading has been behind reports where a still running function gets collected (e.g. https://github.com/python/cpython/issues/160682) + retVal.append("free-threading") except: - return os.getenv("PYTHON_JIT") == '1' + pass + + try: + if sys._jit.is_enabled(): + retVal.append("JIT") + except: + if os.getenv("PYTHON_JIT") == '1': + retVal.append("JIT") + + return ", ".join(retVal) def unhandledExceptionMessage(): """ @@ -4132,6 +4144,7 @@ def unhandledExceptionMessage(): from lib.core.revision import getRevisionNumber # Note: not in the header because of the circular import revision = getRevisionNumber() + buildInfo = pythonBuildInfo() errMsg = "unhandled exception occurred in %s. It is recommended to retry your " % VERSION_STRING errMsg += "run with the latest development version from official GitHub " @@ -4141,8 +4154,7 @@ def unhandledExceptionMessage(): errMsg += "reproduce the bug. Developers will try to reproduce the bug, fix it accordingly " errMsg += "and get back to you\n" errMsg += "Running version: %s%s\n" % (VERSION_STRING[VERSION_STRING.find('/') + 1:], (" (%s)" % revision) if revision else "") - # Note: experimental JIT (Python >= 3.13) has been behind a whole class of reports where an unrelated object ends up bound to a name - errMsg += "Python version: %s%s\n" % (PYVERSION, " (JIT)" if jitEnabled() else "") + errMsg += "Python version: %s%s\n" % (PYVERSION, (" (%s)" % buildInfo) if buildInfo else "") errMsg += "Operating system: %s\n" % platform.platform() errMsg += "Command line: %s\n" % re.sub(r".+?\bsqlmap\.py\b", "sqlmap.py", getUnicode(" ".join(sys.argv), encoding=getattr(sys.stdin, "encoding", None))) errMsg += "Technique: %s\n" % (enumValueToNameLookup(PAYLOAD.TECHNIQUE, getTechnique()) if getTechnique() is not None else ("DIRECT" if conf.get("direct") else None)) diff --git a/lib/core/settings.py b/lib/core/settings.py index 04bd15383..ec21d6119 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.10.21" +VERSION = "1.10.10.22" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)