-
Notifications
You must be signed in to change notification settings - Fork 482
Description
Running OWTF on Python 3.10 or later crashes immediately due to a deprecated import in owtf/utils/http.py. The code uses collections.Mapping, which was moved to collections.abc in Python 3.3 and completely removed from the top-level collections namespace in Python 3.10.
Error:
AttributeError: module 'collections' has no attribute 'Mapping'
Affected file: owtf/utils/http.py (line 44)
The deep_update() function imports collections and uses isinstance(value, collections.Mapping) which breaks on Python 3.10+.
This is a critical issue since Python 3.9 is EOL and most modern systems (Ubuntu 22.04+, Fedora 36+) ship with Python 3.10 or 3.11.
Fix is straightforward - replace:
import collections
isinstance(value, collections.Mapping)
with:
from collections.abc import Mapping
isinstance(value, Mapping)
This maintains backward compatibility with Python 3.3+ while fixing the crash on newer versions.