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
- 0 critical · 0 warn · 107 info
- Scan time
- 30.8 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 47 of 47 warn and critical signals; 47 demoted to info.
- Disclude version
- 4.1.0
- Scanned (UTC)
- 2026-10-22 08:30
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
= = =likely benign docs/conf.py execs the package's own version.py to read the version string.Reasoning
Sphinx conf.py exec-ing the project's own version.py to read __version__ is a common legitimate idiom; the path is built from the repo root, not from untrusted input. Flagged by the scanner only because exec is non-literal.
-
-
# 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 Captures the calling frame to report where reject() was invoked.Reasoning
Hypothesis uses inspect.currentframe to locate the caller for error reporting in reject(); this is ordinary library behaviour.
-
= =likely benign Captures the calling frame to report where assume() was invoked.Reasoning
Same caller-location diagnostic pattern in assume(); benign introspection for error messages.
-
=likely benign Decodes and decompresses a reproduction blob for replaying Hypothesis failures.Reasoning
This is decoding a reproduction blob (base64 then zlib) from a user-supplied @reproduce_failure string, with a zlib.error handler. It is a documented feature for replaying failing examples, not a hidden payload run at import.
-
likely benign Syntax-checks a generated strategy repr for default parameter values.
Reasoning
compile of repr(st.just(default)) inside a suppress(SyntaxError) is a syntax validity check on generated source text, not executing untrusted input.
-
= # Finally, try to work out the imports we need for builds(), .map(), # .filter(), and .flatmap() to work without NameErrorlikely benign Syntax-checks generated strategy expression text.Reasoning
Compiling the generated code string with mode eval only checks syntax of ghostwriter output; compile does not execute code.
-
# executed; so you still shouldn't ghostwrite for hostile code. =likely benign Syntax-checks a repr of an identity value during test generation.Reasoning
compile of repr(identity) is a syntax check that falls back to repr on SyntaxError; the comment shows the author is aware of hostile-code concerns. Compile alone does not run code.
-
# 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 stack frames to compute a size estimate.Reasoning
sys._getframe used to size a call stack for internal utility; ordinary introspection in a testing library.
-
# 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 Reads the caller frame to build a coverage description label.Reasoning
Caller frame lookup to label coverage-related descriptions; benign library introspection.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:265:20=likely benign Evals reconstructed lambda source to rebuild a function for reporting.Reasoning
Evaluates reconstructed lambda source recovered from the library's own source inspection, to rebuild a function object. This is a known pattern for reconstructing lambdas for test-case reporting; the source comes from the code being tested, not an attacker channel.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:298:9) =likely benign Execs generated code to reconstruct a lambda with closure variables.Reasoning
Execs a generated construction stub to rebuild a lambda with its closure and globals. Same library-internal reconstruction pattern; no external untrusted input is evident in the snippet.
-
assert = returnlikely benign Executes reconstructed function source into a namespace with caching.Reasoning
Execs source text for a function being re-created from its own source in the library's reflection helper; the source originates from the user's own code under test, consistent with a legitimate eval cache.
-
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 path analysis on older Python versions.Reasoning
sys.settrace used in a coverage/scrutineer tracer for Python versions below 3.12, explicitly marked as such; standard profiling/tracing practice.
-
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 on exit from the tracer context.Reasoning
Clearing the trace function on exit is the matching teardown for the settrace call; 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 caller for location reporting.Reasoning
sys._getframe walks up the stack skipping Hypothesis-internal frames to report the user's call location. This is a standard, documented introspection technique in a testing library, and the snippet shows no hidden or malicious behaviour.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/strategies/_internal/types.py:227:37: | None = None : | None = = flikely benign Walks frames to record the source location of a type-related definition.Reasoning
sys._getframe walks the frame chain to locate where a strategy is defined, which is used for diagnostics. This is ordinary library introspection with no sign of concealment.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/codemods/test_codemod_cli.py:40:12returnlikely benign Test helper that runs a shell command for codemod CLI tests.Reasoning
A test helper wraps subprocess.run with shell=True on a caller-supplied command. The command comes from test code, not untrusted input, so the risk is limited to test tooling. The critical severity overstates it.
-
info
warn→ info by reviewframe-introspectionhypothesis/tests/conjecture/test_junkdrawer.py:201:16assert ==likely benign Test asserting stack depth via inspect.stack in a recursive function.Reasoning
inspect.stack(0) is used in a test to check stack depth in a recursive helper. This is a normal test technique.
-
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 test over the object's own repr, not untrusted input.
-
=likely benign Round-trips feature flags through repr and eval in a test.Reasoning
Same round-trip test pattern using eval on the object's own repr output.
-
# the line `offset` lines below the `def` statement of the calling function = . return flikely benign Test helper computing the caller's line number via frame introspection.Reasoning
inspect.currentframe().f_back is used in a test helper to compute the expected line number of a calling function. Benign test scaffolding.
-
]: = assert == assert ==likely benign Evaluates pretty-printed regex output to verify round-tripping.Reasoning
eval of pretty-printed repr output checks that the printer round-trips regex objects. This is a test of the pretty printer, operating on values the test constructs.
-
assert ==likely benign Evaluates a repr string in a restricted namespace for float round-trip checks.Reasoning
eval of a repr string with a constrained namespace checks float round-tripping in a test. The inputs are test-controlled.
-
assert ==likely benign Evaluates enum repr strings from parametrized test inputs.Reasoning
eval(rep) over parametrized enum representations asserts that the pretty printer emits valid code. Test inputs are fixed in the test file.
-
assert == f # hexadecimal with underscores assert ==likely benign Evaluates a formatted hexadecimal string to verify its value.Reasoning
eval of formatted hex output checks that the formatting is valid Python for a known value. Benign test assertion.
-
info
warn→ info by reviewdecoder-import-with-exechypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign Decodes a reproduce_failure blob from notes and evals it to rebuild a test.Reasoning
The decoder-plus-exec shape matches the multi-stage payload signal. Here it is the documented @reproduce_failure mechanism, which decodes a base64/zlib blob from test notes and rebuilds a test. That is a legitimate Hypothesis feature, though the blob is decoded and evaluated, so some caution applies.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign Same eval of a decoded reproduction blob as the paired decoder finding.Reasoning
This is the same eval call as the decoder finding, flagged separately as dynamic execution. It belongs to the documented reproduce_failure feature and the input is derived from the library's own encoding.
-
-
-
= = -
= = -
= = -
= = -
= = -
= = -
= = -
= = -
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:37:1= == 3.1415likely benign Defines a lambda with a Greek letter in its identifier to test unicode handling.Reasoning
A deliberate Unicode identifier mixing Latin and Greek is the test subject, which checks that the library handles unicode identifiers. It is intentional, not obfuscation.
-
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:41:44assert ==likely benign Uses the mixed-script unicode identifier in a description test.Reasoning
Same deliberate mixed-script identifier, used to test function description output for unicode names.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/recorded/magic_builtins.txt:112:5eval(source, globals, locals)likely benign Recorded example output containing an eval call in a test fixture file.Reasoning
This is recorded ghostwriter output in a text fixture, showing eval on a string literal as an example of generated code. It is not executed by a scanner-visible runtime path, and the context is documentation or a recording.
-
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 helper executes generated Python source to check it compiles and runs without NameError.Reasoning
Test file in Hypothesis ghostwriter suite; exec of generated source code that was already compared to expected output. The base64 import is incidental to a test harness, not a decoder pipeline.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_expected_output.py:302:5assert == # We got the expected source code # and there are no SyntaxError or NameErrorslikely benign exec of expected generated source in a test assertion.Reasoning
exec on a variable holding expected generated code inside a test; the expression is test data, not attacker-controlled input.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_expected_output.py:317:5assert ==likely benign Test executes generated source code with a fixed namespace.Reasoning
Same test pattern executing generated code with a controlled namespace dict.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_expected_output.py:339:5assert == # We got the expected source code # and there are no SyntaxError or NameErrorslikely benign Test executes expected generated source for validity checking.Reasoning
Repeated test pattern verifying generated code executes; no external input reaches exec.
-
likely benign Test helper execs generated source code inside a try block.
Reasoning
Helper in a test module that execs generated source and prints it on failure; a normal verification idiom.
-
=likely benign Test execs output of ghostwriter.magic.Reasoning
Test checks that ghostwriter-generated code runs; source comes from the library under test.
-
=likely benign Test execs output of ghostwriter.binary_operation.Reasoning
Same generated-code verification pattern in a test.
-
# Most importantly: the code should execute without NameErrorlikely benign Test execs generated source to check for NameError.Reasoning
Test verifying generated code executes without NameError; benign.
-
= # and also works with explicit identity element =likely benign Test execs binary_operation output.Reasoning
Generated code from the library is exec'd in a test; benign test verification.
-
=likely benign Test execs binary_operation output with identity argument.Reasoning
Same benign test verification of generated source.
-
assert inlikely benign Test execs generated source containing one_of.Reasoning
Test execs one_of-containing generated source; benign.
-
= # Also cover passing an explicit `annotate`, rather than the default None. =likely benign Test execs ufunc-generated source.Reasoning
Test execs ufunc generator output; benign.
-
=likely benign Test execs ufunc-generated source with annotate option.Reasoning
Test execs ufunc generator output with annotate; benign.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_ghostwriter_cli.py:43:12returnlikely benign Test helper runs a shell command via subprocess with shell=True.Reasoning
A small test helper wrapping subprocess with shell=True. Command strings are supplied by test code, so the risk is low, though shell=True with a non-literal command is a bad practice worth noting.
-
= = = assert ==likely benign Test evals strategy repr string to check round-trip stability.Reasoning
Test evaluates repr of Hypothesis strategies in a controlled globals dict to check round-trip repr; no untrusted input.
-
assert ==likely benign Test evals sampled strategy repr to compare against itself.Reasoning
Parametrized test evaluating repr strings of sampled transforms; benign test code.
-
= = =likely benign A numpy floor/ceil test uses eval on a test parameter to build an array.Reasoning
The eval call sits in a test function parameterized by value, most likely a test fixture that feeds literal or generated array expressions into floor/ceil comparisons. Eval on a test parameter is a poor practice and a dynamic-execution signal, but in a test file with no network, shell, or encoded payload involvement it is most plausibly a benign testing pattern. The doubt is that the value source is not shown.
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.
&&