sqlmapproject/sqlmap · error · TypeError

serialization of type '%s' is not supported

Error message

serialization of type '%s' is not supported

What it means

Error "serialization of type '%s' is not supported" thrown in sqlmapproject/sqlmap.

Source

Thrown at lib/core/convert.py:154

    if isinstance(value, datetime.timedelta):
        return {_SERIALIZE_TAG: "td", "v": [value.days, value.seconds, value.microseconds]}

    name = "%s.%s" % (value.__class__.__module__, value.__class__.__name__)
    if name in _SERIALIZE_CLASSES:
        return {_SERIALIZE_TAG: "o", "c": name, "s": _serializeEncode(dict(value.__dict__))}

    return _serializeUnknown(value, name)

def _serializeUnknown(value, name):
    """
    Fallback for a type not explicitly handled by the serializer
    """

    # sqlmap's own (or bundled) classes MUST be added to the allowlist explicitly - fail loudly
    # (caught by the regression tests) rather than silently store something that cannot be restored
    if (name or "").split(".")[0] in ("lib", "plugins", "thirdparty"):
        raise TypeError("serialization of type '%s' is not supported" % name)

    # a foreign/exotic scalar (e.g. an unusual DB-driver value): degrade to its textual form rather
    # than crash a user's session - session values are only ever rendered (getUnicode) downstream
    singleTimeWarnMessage("serializing value of unsupported type '%s' as text" % name)
    return getUnicode(value)

def _serializeDecode(struct):
    """
    Restores a Python value from a JSON-deserialized (tagged) structure
    """

    if struct is None or isinstance(struct, bool) or isinstance(struct, float) or isinstance(struct, six.integer_types):
        return struct

    if isinstance(struct, six.text_type):
        return struct

    if isinstance(struct, six.binary_type):  # defensive - json.loads() yields text, not bytes

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at lib/core/convert.py:154 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/5ef6dd2704cfa38e. Report an issue: GitHub.