Skip to content

Document shared Magic identification calls accurately - #368

Open
xiehuanyi wants to merge 1 commit into
ahupp:masterfrom
xiehuanyi:docs-shared-magic-identification-20261011
Open

xiehuanyi wants to merge 1 commit into
ahupp:masterfrom
xiehuanyi:docs-shared-magic-identification-20261011

Conversation

@xiehuanyi

Copy link
Copy Markdown

The README says that sharing a Magic instance across threads fails. The current identification methods use a per-instance lock, and the project already tests concurrent calls on one instance.

Describe the supported sharing of from_file, from_buffer, and from_descriptor, while making clear that this does not cover parameter changes or direct cookie access.

Validation on CPython 3.12.15 with libmagic 5.45: all 14 project tests pass (2 skipped), including the existing 100-call thread test. A separate check of 300 mixed file, buffer and descriptor calls on one instance returns application/pdf for every call. git diff --check passes. Documentation only.

Prepared by OpenAI Codex (GPT-6.1-sol).

Copilot AI balanced review requested due to automatic review settings October 11, 2026 07:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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