PyPI / decorator / 5.3.1

decorator 5.3.1

Source
https://github.com/micheles/decorator
Artifact scanned
decorator-5.3.1-py3-none-any.whl (wheel · 10.1 KB · SHA-256 f47fe6fdbd2e…)
Compared with
decorator-5.3.0-py3-none-any.whl (0 signals introduced since)
Files
4 scanned, 4 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 3 info
Scan time
4.0 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 3 of 3 warn and critical signals; 3 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-10-23 09:33

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info critical → info by review frame-introspection decorator/__init__.py:141:21

    `sys._getframe` — call-stack frame introspection — file also calls `sys.exit`/`exec`/`eval` (anti-analysis shape) (ast pass, confidence 0.85)

            try:
                frame = sys._getframe(3)
            except AttributeError:  # for IronPython and similar implementations
                callermodule = '?'
    likely benign LLM, confidence 0.93 Call-stack frame lookup used to determine the caller's module name, with a fallback for implementations lacking sys._getframe.
    Reasoning

    This is the decorator library's caller-module lookup. sys._getframe(3) is wrapped in try/except AttributeError with a comment about IronPython, so it is a compatibility fallback for finding the calling module's name. The 'anti-analysis' note comes from a file-level heuristic, and nothing here evades analysis or hides behaviour.

  2. info warn → info by review dynamic-execution decorator/__init__.py:173:20

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            try:
                code = compile(src, filename, 'single')
                exec(code, evaldict)
            except Exception:
    likely benign LLM, confidence 0.92 compile() of generated function source to preserve decorated function signatures.
    Reasoning

    The decorator library compiles generated wrapper source so that decorated functions keep their exact signatures. The source is built from the decorated function's own signature inside the library, not from external or remote input, and it runs in a controlled evaldict namespace. This is a known, documented technique in a widely used library.

  3. info warn → info by review dynamic-execution decorator/__init__.py:174:13

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

                code = compile(src, filename, 'single')
                exec(code, evaldict)
            except Exception:
                print('Error in generated code:', file=sys.stderr)
    likely benign LLM, confidence 0.92 exec() of library-generated wrapper code inside a dedicated namespace to build signature-preserving decorators.
    Reasoning

    This exec is paired with the compile call above. It runs the signature-preserving wrapper code the library generates for decorated functions, inside a dedicated evaldict namespace. The surrounding code shows no network access, encoded payload, or external source; it is the normal mechanism of the decorator package.

Reproduce This Scan

Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.3.0
curl -fsSL -o decorator-5.3.1-py3-none-any.whl https://files.pythonhosted.org/packages/05/7f/798705f5296a58ca505d600456748d1be48078eac8a7050d8a98bc9edb89/decorator-5.3.1-py3-none-any.whl
printf '%s  %s\n' f47fe6fdbd2edd623ecfe36875d37aba411624e2670dd395dddae1358689bb3c decorator-5.3.1-py3-none-any.whl | shasum -a 256 -c -
unzip -q decorator-5.3.1-py3-none-any.whl -d pkg
disclude scan --untrusted --severity info pkg