folded file names in MIME headers are interpreted incorrectly by part.get_filename()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python |
Unknown
|
Unknown
|
|||
python3.10 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
If the filename in the header field of a MIME attachment is folded, the `get_filename()` function doesn't return the correct file name. It's supposed to ignore folded CRLFs but doesn't.
Script which illustrates the bug:
#!/usr/bin/env python3
import email
message = email.message_
MIME-Version: 1.0
Content-Type: text/plain; name="This File Name Is
Folded.pdf"
Content-
Folded.pdf"
Content-
Foo
""")
print(message.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: libpython3.
ProcVersionSign
Uname: Linux 5.15.0-39-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Sun Jun 19 15:49:23 2022
InstallationDate: Installed on 2019-01-02 (1264 days ago)
InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.3)
SourcePackage: python3.10
UpgradeStatus: Upgraded to jammy on 2022-02-20 (118 days ago)