Bug 455257 - MTP transfer fails for files with the double quote (") character in the file name
Summary: MTP transfer fails for files with the double quote (") character in the file ...
Status: RESOLVED UPSTREAM
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: MTP (show other bugs)
Version: 22.04.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-14 14:39 UTC by Heinrich Zander
Modified: 2022-06-14 19:43 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Zander 2022-06-14 14:39:13 UTC
SUMMARY

When I tried to copy files from my computer to my android device (Pixel 6), there was a file with quotes (") in the filename. When dolphin tried to transfer this file a dialog box opened up, which said the file could not be copied. Even after I clicked "Skip this file" in the dialog, the transfer did not continue and hangs forever on the next file.
This is strange because other files with unicode characters like umlauts and japanese characters get transferred just fine.


STEPS TO REPRODUCE
1. Connect android device using MTP.
2. Try to copy a file containing a double quote in its filename.
3. The transfer of the file fails.

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
kio-extras Version: 22.04.2

ADDITIONAL INFORMATION
Comment 1 Harald Sitter 2022-06-14 19:43:05 UTC
This is most likely a variant of https://github.com/libmtp/libmtp/issues/71 specifically " is a reserved character on windows [1] so it appearing in filenames wouldn't be portable and your phone may consequently reject the filename. I've had a look at our code and we do nothing fancy with the name, so whatever is wrong is inside libmtp and that linked issue seems like the prime candidate (e.g. note how the reserved windows characters are missing from the expression on the s10, most notably " is missing)

[1] https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file