Skip to content

Workaround multipart title mangling issue#365

Merged
don-vip merged 1 commit intomasterfrom
fix/multipart-title-mangling
Apr 13, 2026
Merged

Workaround multipart title mangling issue#365
don-vip merged 1 commit intomasterfrom
fix/multipart-title-mangling

Conversation

@Amdrel
Copy link
Copy Markdown
Collaborator

@Amdrel Amdrel commented Apr 13, 2026

Relevant issue: #362

It looks like pywikibot uses Python's built-in multipart handling which has an issue with mangling lines starting with 'From' (MBOX escaping). This patch edits the policy that pywikibot uses to disable that feature.

Since we're just using multipart to upload files and not sending emails, I would assume there is no security risk in this change.

See: https://runebook.dev/en/docs/python/library/email.policy/email.policy.Policy.mangle_from_

@Amdrel Amdrel requested a review from don-vip April 13, 2026 18:11
It looks like pywikibot uses Python's built-in multipart handling which
has an issue with mangling lines starting with 'From' (MBOX escaping).
This patch edits the policy that pywikibot uses to disable that feature.

Since we're just using multipart to upload files and not sending emails,
I would assume there is no security risk in this change.

See: https://runebook.dev/en/docs/python/library/email.policy/email.policy.Policy.mangle_from_
@Amdrel Amdrel force-pushed the fix/multipart-title-mangling branch from 35243bc to 5069725 Compare April 13, 2026 18:14
@don-vip don-vip merged commit 636ea7a into master Apr 13, 2026
5 checks passed
@don-vip
Copy link
Copy Markdown
Collaborator

don-vip commented Apr 13, 2026

Wow thanks a lot for finding a fix so fast ❤️

@don-vip don-vip deleted the fix/multipart-title-mangling branch April 13, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants