PyPI / hypothesis / 6.170.5
hypothesis 6.170.5
- Source
- https://github.com/HypothesisWorks/hypothesis
- Tag scanned
v6.170.5- Directory
hypothesis- Compared with
v6.170.4(0 signals introduced since)- Files
- 537 scanned, 16 skipped (binary, oversized, or unrecognised)
- Signals
- 1 critical · 14 warn · 92 info
- Scan time
- 26.5 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 32 of 47 warn and critical signals; 32 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-20 00:58
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
return -
assert == # We got the expected source code # and there are no SyntaxError or NameErrors -
assert == -
assert == # We got the expected source code # and there are no SyntaxError or NameErrors -
-
= -
= -
# Most importantly: the code should execute without NameError -
= # and also works with explicit identity element = -
= -
assert in -
= # Also cover passing an explicit `annotate`, rather than the default None. = -
= -
= = = assert == -
assert == -
= = =likely benign Docs config execs the project's own version.py to read __version__.Reasoning
The exec reads the version.py file from the project's own source tree and runs it into a dict to extract __version__. This is a common Sphinx docs pattern; the path is a fixed local file, not attacker-controlled data or a network payload. Flagged as critical by severity heuristics, but the context is benign.
-
-
# Run all the no-extra-dependency tests for this version (except slow nocover tests) # Run tests for each extra module while the requirements are installed -
-
-
-
-
-
-
-
-
# Run some tests without docstrings or assertions, to catch bugs -
# like issue #822 in one of the test decorators. See also #1541. PYTHONOPTIMIZE=2 -
-
-
-
# like issue #822 in one of the test decorators. See also #1541. PYTHONOPTIMIZE=2 -
-
-
-
-
-
if [; then -
-
-
-
if [ ; then -
-
-
# ...but running twice takes time, don't overdo it -
# ...but running twice takes time, don't overdo it else -
else fi -
) = =likely benign Uses frame introspection to report where reject() was called.Reasoning
inspect.currentframe is used to locate the caller for error reporting in reject(). Legitimate library introspection for diagnostics.
-
= =likely benign Uses frame introspection to report where assume() was called.Reasoning
Same pattern as reject(): frame lookup for assume() call-site reporting in a testing library. Benign.
-
=likely benign Decompresses a zlib-encoded serialized example blob in Hypothesis's example database handling.Reasoning
zlib.decompress on a database-stored or serialized example with a version prefix byte, wrapped in try/except zlib.error. This is Hypothesis's own example serialization format, a normal decoding step rather than a hidden payload.
-
likely benign Compiles a repr string solely to test syntax validity of a default value.
Reasoning
compile(repr(...)) is used only as a syntax validity check on a repr string of a strategy, inside contextlib.suppress(SyntaxError). It does not execute attacker input.
-
= # Finally, try to work out the imports we need for builds(), .map(), # .filter(), and .flatmap() to work without NameErrorlikely benign Syntax-checks a generated strategy expression string via compile.Reasoning
compile(r, ..., 'eval') validates a generated expression string for syntax only; no execution occurs. Ghostwriter code generation, benign.
-
# executed; so you still shouldn't ghostwrite for hostile code. =likely benign Syntax-checks a repr of an identity value during ghostwriting.Reasoning
compile(repr(identity), ..., 'exec') is a syntax check on a repr string with a SyntaxError fallback. The comment itself notes the tool should not be used for hostile code, and no code is run from untrusted input.
-
# The sum of a geometric series is given by (ref: wikipedia): # ᵐ∑ₖ₌₀ aᵏ = (aᵐ⁺¹ - 1) / (a - 1) # = S(m) / S(0) # assuming a != 1 and using the definition -
# The sum of a geometric series is given by (ref: wikipedia): # ᵐ∑ₖ₌₀ aᵏ = (aᵐ⁺¹ - 1) / (a - 1) # = S(m) / S(0) # assuming a != 1 and using the definition -
# assuming a != 1 and using the definition # S(m) := aᵐ⁺¹ - 1. # The sum we want, starting from a number n [0 <= n <= m] rather than zero, is # ᵐ∑ₖ₌ₙ aᵏ = ᵐ∑ₖ₌₀ aᵏ - ⁿ⁻¹∑ₖ₌₀ aᵏ = S(m) / S(0) - S(n - 1) / S(0) -
# The sum we want, starting from a number n [0 <= n <= m] rather than zero, is # ᵐ∑ₖ₌ₙ aᵏ = ᵐ∑ₖ₌₀ aᵏ - ⁿ⁻¹∑ₖ₌₀ aᵏ = S(m) / S(0) - S(n - 1) / S(0) return ** - 1 -
# The sum we want, starting from a number n [0 <= n <= m] rather than zero, is # ᵐ∑ₖ₌ₙ aᵏ = ᵐ∑ₖ₌₀ aᵏ - ⁿ⁻¹∑ₖ₌₀ aᵏ = S(m) / S(0) - S(n - 1) / S(0) return ** - 1 -
# The sum we want, starting from a number n [0 <= n <= m] rather than zero, is # ᵐ∑ₖ₌ₙ aᵏ = ᵐ∑ₖ₌₀ aᵏ - ⁿ⁻¹∑ₖ₌₀ aᵏ = S(m) / S(0) - S(n - 1) / S(0) return ** - 1 -
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/internal/conjecture/junkdrawer.py:316:13""" frame = sys._getframe(2) size = 1 while frame:likely benign Walks the call stack via sys._getframe for internal bookkeeping.Reasoning
sys._getframe(2) used to walk the stack for size/depth reporting in a testing utility. Benign introspection.
-
# common unicode characters , # characters which increase in length when lowercased -
# common unicode characters , # characters which increase in length when lowercased -
# common unicode characters , # characters which increase in length when lowercased -
# ligatures , # emoticons , -
# upsidown text , # reserved strings in windows , -
# upsidown text , # reserved strings in windows , -
# upsidown text , # reserved strings in windows , -
# upsidown text , # reserved strings in windows , -
# upsidown text , # reserved strings in windows , -
�̲e͇̣̰̦̬͎ ̢̼̻̱̘h͚͎͙̜̣̲ͅi̦̲̣̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣ -
�̜̣̲ͅi̦̲̣̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣ -
�̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣ -
�͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣ -
# stack frames up. = = = flikely benign Uses sys._getframe to label a coverage entry with the caller's location.Reasoning
sys._getframe used to find the caller's filename and line for coverage-related descriptions. Standard for coverage tooling.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:265:20=likely benign Evaluates reconstructed lambda source to rebuild a callable.Reasoning
eval on source reconstructed from the lambda's own code object when extracting lambda source for repr. Expected behavior for this module; the source comes from the user's own code being introspected, not an external payload.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:298:9) =likely benign Execs a generated helper to reconstruct a lambda with closure variables.Reasoning
exec of a generated construction string that rebuilds a lambda with its free variables, in the function's own globals. Same benign lambda-reconstruction purpose as the nearby eval.
-
assert = returnlikely benign Execs source text into a module namespace to materialize a function.Reasoning
exec of source into a new module dict to build a function from source text, used for reconstructing callables with cache. This is a dynamic-code utility intrinsic to the library's reflection module; the source is derived from the caller's own code, not a hidden remote payload.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/internal/scrutineer.py:114:13# pragma: no cover # only on Python < 3.12 returnlikely benign Installs a trace function for scrutineer's coverage analysis.Reasoning
sys.settrace installs a tracer for coverage/scrutiny analysis during a test, guarded by a check for sys.monitoring on older Python versions. Standard tracing use.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/internal/scrutineer.py:137:13# pragma: no cover # only on Python < 3.12 returnlikely benign Removes the trace function set by scrutineer.Reasoning
Matching sys.settrace(None) teardown after the tracing context. Benign.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/strategies/_internal/strategies.py:102:31return : | None = =likely benign Walks the call stack to find the first non-Hypothesis frame for location reporting.Reasoning
sys._getframe is used to walk up the stack past Hypothesis's own files to locate the user's calling site for reporting. This is a common, legitimate library pattern.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/strategies/_internal/types.py:227:37: | None = None : | None = = flikely benign Iterates stack frames to build a source location string.Reasoning
sys._getframe is used to walk the stack and record file and line locations, which is a debugging and reporting aid with no sign of malicious use.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/codemods/test_codemod_cli.py:40:12returnlikely benign Test helper wrapping subprocess.run with shell=True for CLI codemod tests.Reasoning
This is a small test helper that runs a shell command with shell=True. The command comes from the test code, not from untrusted input, so the risk is limited to test execution in a repository the maintainers control.
-
info
warn→ info by reviewframe-introspectionhypothesis/tests/conjecture/test_junkdrawer.py:201:16assert ==likely benign Test asserting inspect.stack depth in a recursive function.Reasoning
inspect.stack(0) is used in a recursion test to check stack depth matches the caller's depth. It is a test of Hypothesis internals with no malicious behavior.
-
assert not = assert assert notlikely benign Round-trips a feature flags object through repr and eval in a test.Reasoning
eval(repr(flags)) is a round-trip serialization check on a flags object the test itself constructs, so the evaluated string is trusted test data.
-
=likely benign Round-trips feature flags through repr and eval in a test.Reasoning
Same repr/eval round-trip pattern on a locally constructed flags object, used to check serialization fidelity.
-
# the line `offset` lines below the `def` statement of the calling function = . return flikely benign Gets the caller's frame to compute an expected source location in a test.Reasoning
inspect.currentframe().f_back is used to find the caller's definition line for a test assertion about reported locations.
-
]: = assert == assert ==likely benign Evaluates pretty-printed regex output to verify round-tripping.Reasoning
eval of pretty-printed regex output is a round-trip test that checks the pretty printer's output is valid, using repr strings the test generates.
-
assert ==likely benign Evaluates a float repr in a restricted namespace to test lexical encoding.Reasoning
eval of a repr string with a restricted namespace is used to check float serialization in a test. The input is generated locally.
-
assert ==likely benign Evals enum representation strings from test parameters.Reasoning
eval of parametrized repr strings verifies that enums pretty-print as valid code. The inputs are fixed test parameters.
-
assert == f # hexadecimal with underscores assert ==likely benign Evals a hex-formatted integer to verify round-tripping in a test.Reasoning
eval of a formatted integer string in a test checks that the formatted output round-trips to the original value.
-
info
warn→ info by reviewdecoder-import-with-exechypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign Decodes and evals a reproduction blob extracted from test notes.Reasoning
The file imports base64 and zlib, and eval runs on a regex match from the notes. This matches Hypothesis's @reproduce_failure decoding path, which is a documented feature. The snippet is consistent with library behavior, not a dropper, but the eval of extracted text is a pattern to note.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign Same reproduce_failure eval of an extracted reproduction string.Reasoning
This is the same eval call as the decoder-pattern finding, flagged separately as dynamic execution. It is part of the reproduce_failure feature and reads data the library itself generated.
-
-
-
= = -
= = -
= = -
= = -
= = -
= = -
= = -
= = -
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:37:1= == 3.1415likely benign Lambda assigned to a Greek-letter identifier in a unicode identifier test.Reasoning
The mixed Latin and Greek identifier is deliberate, as the test file name shows. It exercises Python's support for unicode identifiers.
-
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:41:44assert ==likely benign Test using a mixed-script unicode identifier in a lambda description check.Reasoning
The unicode identifier is intentional test input checking that function descriptions work with non-ASCII names.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/recorded/magic_builtins.txt:112:5eval(source, globals, locals)dismissed eval shown in a recorded text fixture for ghostwriter output.Reasoning
This is a recorded text fixture containing prose or markup showing an eval call, not executable code in the repository. The finding is a false positive from scanning a text file.
-
info
warn→ info by reviewdecoder-import-with-exechypothesis/tests/ghostwriter/test_expected_output.py:302:5assert == # We got the expected source code # and there are no SyntaxError or NameErrorslikely benign Test asserts generated source code is executable via exec.Reasoning
Test file for Hypothesis ghostwriter; exec runs generated source code to check it compiles. Decoder import is incidental to test helpers, not a payload.
-
= = =likely benign A numpy test helper calls eval on a test parameter to build an array for floor and ceil comparisons.Reasoning
The eval call sits in a test function whose parameter 'value' is likely supplied by a parametrize decorator with literal test data, such as lists of numbers. Using eval to turn a string parameter into a numpy array is a crude but ordinary test-authoring pattern. It is not obfuscation or a dropper, and nothing in the snippet shows attacker-controlled input. The non-literal eval is still poor practice, so the finding is not fully dismissed.
Reproduce This Scan
Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
&&