PyPI / platformdirs / 4.13.1
platformdirs 4.13.1
- Source
- https://github.com/tox-dev/platformdirs
- Tag scanned
4.13.1- Compared with
4.13.0(0 signals introduced since)- Files
- 33 scanned, 6 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 5 info
- Scan time
- 6.9 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 5 of 5 warn and critical signals; 5 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-16 17:10
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
likely benign Documentation example showing a Windows command invocation of python with an environment variable.
Reasoning
The flagged line is a Windows cmd prompt example in an RST code block, showing a user running python -c to print a directory after setting an environment variable. The '>' is a shell prompt, not a redirect. The PATH-hijack signal is a false match on documentation prose.
-
likely benign Doc example line whose Windows path backslashes triggered an escape-sequence heuristic.
Reasoning
The 'backslash escape sequences' are Windows path separators in the example output (X:\appdata\Acme\...) being misread as escapes in a command name. The snippet is ordinary documentation of a python one-liner and its output.
-
= =likely benign Test utility that temporarily overrides PlatformDirs attributes and saves the originals for later restoration.Reasoning
This is a test helper that saves original class attributes via vars(), applies patches with setattr, and then presumably restores them. This is a standard monkeypatch-and-restore pattern in a testing module, and the reflective access is what that pattern needs.
-
= # ty: ignore[invalid-assignment] dellikely benign Test code that temporarily swaps builtins.__import__ to simulate import behavior, then restores it.Reasoning
Within a try block, the test replaces builtins.__import__ with a fake importer to simulate an import environment, then clears platformdirs modules from sys.modules. The paired restore at line 177 indicates a scoped test fixture rather than persistent malicious patching. The pattern is unusual but is a recognizable test technique.
-
# restore original modules = =likely benign Test cleanup that restores the original builtins.__import__ and sys.modules entries.Reasoning
This is the restore half of the same test-scoped patch: builtins.__import__ is reset to the saved builtin_import and the platformdirs modules are reinserted into sys.modules. The restore confirms the patch is temporary and does not persist beyond the test.
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.
&&