Skip to content

Conversation

@dguido
Copy link
Member

@dguido dguido commented Jan 23, 2026

Summary

  • Adds ScanResult class with is_safe, severity, results, and errors attributes
  • Adds scan_file() function for graceful single-file scanning
  • Adds scan_archive() function for scanning ZIP archives with graceful error handling
  • Adds RelaxedZipFile class that ignores CRC validation errors (matches PyTorch behavior)
  • Exports new functions from package for easy programmatic use

API Example

import fickling

# Scan a single file
result = fickling.scan_file("model.pkl")
if not result:
    print(f"Unsafe: {result.severity}")
    for error in result.errors:
        print(f"  Error: {error}")

# Scan an archive
results = fickling.scan_archive("models.zip")
for name, result in results.items():
    print(f"{name}: {'safe' if result else 'unsafe'}")

Test plan

  • All existing tests pass
  • Linters pass
  • Manual testing with corrupted archives

🤖 Generated with Claude Code

- Add ScanResult class with is_safe, severity, results, and errors
- Add scan_file() for graceful single-file scanning
- Add scan_archive() for scanning ZIP archives
- Add RelaxedZipFile class that ignores CRC validation errors
- Add _scan_bytes() helper for in-memory scanning
- Export new functions from package

This API provides picklescan-like graceful degradation, continuing
to scan even when individual files fail to parse.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dguido dguido requested a review from ESultanik as a code owner January 23, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants