filelock 4.2.4
- Source
- https://github.com/tox-dev/py-filelock
- Tag scanned
4.2.4- Compared with
4.2.3(0 signals introduced since)- Files
- 95 scanned, 9 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 1 warn · 22 info
- Scan time
- 18.1 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 23 of 23 warn and critical signals; 22 demoted to info.
- Disclude version
- 4.1.0
- Scanned (UTC)
- 2026-10-21 22:20
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
likely benign An audit hook that re-applies the profile function so the probe's hook persists during nested checks.
Reasoning
An audit hook re-installs the profile function when setprofile is called, which is unusual. In a capability probe, it appears designed to keep the probe's hook in place for the nested test. The context is a test harness, so the behaviour looks like test scaffolding rather than persistence.
-
likely benign A Compose embedded bash snippet that copies the repo to a home-directory work area, installs it, and runs tox.
Reasoning
The embedded bash is a plain copy-repo, pip install, and tox run sequence. The `$$` is standard Compose escaping for a shell variable, so the variable command name is an environment-dependent reference rather than a hidden payload. The file looks like a CI or test helper.
-
= = returnlikely benign A module-level lazy attribute loader that uses getattr and globals() to resolve names on demand.Reasoning
The module-level globals() assignment and getattr lookup implement lazy attribute loading for public names such as AsyncFileLock. This is a common Python pattern for deferred imports and has no sign of concealment or malicious intent.
-
return =likely benign Records the current call frame on the lock object to track release re-entrancy.Reasoning
inspect.currentframe() is stored on the lock's releasing state so the library can detect re-entrant release from the same frame. This is internal lock bookkeeping in a well-known locking library.
-
= 0 = # Created once, so a directory that disappears while the acquisition waits fails it, not builds a secondlikely benign Stores the current frame on the lock context during acquisition for re-entrancy tracking.Reasoning
The current frame is saved on the context while acquisition is in progress, which is the same kind of re-entrancy bookkeeping as the release path. It is not dynamic execution or exfiltration.
-
return False = =likely benign Walks the call stack via f_back to find whether a target frame is an ancestor.Reasoning
The code walks the f_back chain to check whether a given frame is on the call stack. This is ordinary stack inspection used to detect a caller's frame.
-
: =likely benign Temporarily installs a profile hook to probe interrupt behaviour during a capability check.Reasoning
This is a test-tooling capability probe in a filelock repo. It installs a temporary profile hook to test whether interrupts or profiling affect locking, and restores the previous hook in a finally block. The profiler use is unusual but consistent with a dev harness, not an attack.
-
returnlikely benign Restores the prior profile function after the probe finishes.Reasoning
This is the restore step in the finally block of the same probe, reinstating the previous profile function. It is cleanup, not a sign of malicious behaviour.
-
return Falselikely benign Probes whether setting the profile function is permitted, returning False on RuntimeError.Reasoning
This re-reads and re-sets the current profile function and catches RuntimeError to detect whether profiling is permitted. It is a feature probe in the test tooling, with no sign of an attack.
-
likely benign Installs a profile hook in a test to trigger and observe singleton cache lookups during lock construction.
Reasoning
The test installs a profile callback to intercept the cache lookup during construction of an AsyncFileLock singleton, then clears it. This is a targeted concurrency or reentrancy test and is typical in a locking library's test suite.
-
likely benign Clears the test profile hook in a finally block.
Reasoning
This is the cleanup in a finally block that clears the test profile hook, which is standard test hygiene.
-
likely benign Installs a profile hook in a test to exercise the singleton cache path during FileLock construction.
Reasoning
The test uses a profile callback to hit the singleton cache path during FileLock construction, which is a standard way to test reentrancy in the library's own test suite.
-
returnlikely benign Resets the test profile hook in a finally block.Reasoning
This is test cleanup that resets the profile hook in a finally block.
-
: =likely benign Installs an interrupt profile hook around an operation in a lock test.Reasoning
The test installs an interrupt-style profile callback around an operation to check that lock state holds up under an interrupt. It is a test of the library's own behaviour.
-
return Falselikely benign Clears the interrupt profile hook after the test operation.Reasoning
This is the finally-block cleanup that clears the test profile hook.
-
dellikely benign Installs a profile hook that looks up the lock during its close, to test a reentrancy edge case.Reasoning
The test sets a profile callback to look up the lock while it is closing, which probes a reentrancy edge case in the read-write lock. This is typical test instrumentation.
-
likely benign Clears the test profile hook in a finally block.
Reasoning
This is the finally-block cleanup of the test profile hook.
-
assert is Nonelikely benign Test helper installs a profile hook to inject a pause during lease claim creation.Reasoning
sys.setprofile is used in a test to pause a thread at a specific point during claim creation to force a race condition for testing. This is a legitimate testing technique in a test file for a lock library; no malicious behavior is evident.
-
: =likely benign Cleanup that removes the test profile hook after the race-condition read.Reasoning
The matching sys.setprofile(None) in a finally block just uninstalls the test profile hook. This is test-harness cleanup with no malicious indicators.
-
= . + 1likely benign Test records the current line number to verify a lifetime warning's location.Reasoning
sys._getframe().f_lineno is used to compute the expected line number of a warning so the test can assert the warning points at the correct source line. Standard test technique in a lock library's test suite.
-
= = . + 1 = 10likely benign Test captures the caller line number to check warning attribution.Reasoning
Same pattern: sys._getframe() used to capture the expected warning line for assertion in a test. Benign introspection in test code.
-
= . + 1likely benign Test captures line number to validate a lifetime warning's reported location.Reasoning
Duplicate test pattern of sys._getframe().f_lineno for verifying warning location in a test; no malicious behavior.
-
= = . + 1 = 10likely benign Test captures line number for lifetime-setter warning location check.Reasoning
Same benign test-assertion use of sys._getframe for warning line verification in the lifetime setter path.
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.
&&