Bug 489288

Summary: File transfer fails if it contains a question mark, semicolon or quotes
Product: [Frameworks and Libraries] kio-extras Reporter: Andrea Ippolito <andrea.ippo>
Component: MTPAssignee: Unassigned bugs <unassigned-bugs-null>
Status: REPORTED ---    
Severity: normal CC: dev, elvis.angelaccio, rauchwolke
Priority: NOR    
Version First Reported In: 24.05.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=455257
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: journalctl when the problem happens

Description Andrea Ippolito 2024-06-27 08:16:46 UTC
I connected my Pixel 8 Pro to copy some (MP3) music from Dolphin.

When the copy process reaches certain files, it hangs indefinitely. Canceling the process also makes the MTP device no longer usable until it's disconnected and reconnected.

I tried to isolate the problem, and the files causing all contain some special characters. The ones I could confirm to be causing trouble are `?`, `:`, `"`

Weirdly enough, if I try to transfer a dummy TEXT file instead (containing one of those chars), I get immediately a popup informing me the file cannot be transferred.

This is not the case when transferring MP3s, though. Even if I try to transfer just ONE MP3 containing one of those characters, the copy still starts without any warning, and hangs.

If I expand the ongoing copy notification, I can see that the target file name contains the special character as an URL-escaped sequence (e.g. `%3F` for `?`)

Attaching logs from journalctl
Comment 1 Andrea Ippolito 2024-06-27 08:17:59 UTC
Created attachment 171071 [details]
journalctl when the problem happens
Comment 2 Andrea Ippolito 2024-06-27 08:18:26 UTC
System info:

Operating System: openSUSE Tumbleweed 20240624
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.5-1-default (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon 780M Graphics
Memory: 30.7 GiB of RAM
Graphics Processor: AMD Radeon 780M
Manufacturer: Framework
Product Name: Laptop 13 (AMD Ryzen 7040Series)
System Version: A7
Comment 3 Jim Jones 2025-02-06 14:25:06 UTC
i can reproduce the bug here, the user should get notified that the transfer broke

a dialog that gets shown that allow the user to rename the file and/or allows the user to chech a checkbox like
"make the filename compatible" and if checked, it would just remove special chars, or replace them with an underline aka "_"
Comment 4 dev 2025-04-22 09:59:44 UTC
Had the same bug, Searched a bit, saw a similar bug on double quote characters (that I linked in the see Also)
The culprit is windows with their reserved characters.
The bug has already been reported upstream to libmtp, but I agree with Jim Jones above. It's preferable to check if the file is correctly formatted and if not, notify the user.
I've never contributed to the KDE codebase, but if I have the time, I will try to see if I can do something about it.