Bug 428115 - k3b silently drops files whose names contain special characters when adding to project
Summary: k3b silently drops files whose names contain special characters when adding t...
Status: RESOLVED FIXED
Alias: None
Product: k3b
Classification: Applications
Component: Data Project (show other bugs)
Version: 19.04
Platform: Mageia RPMs Linux
: NOR major
Target Milestone: ---
Assignee: k3b developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-22 22:36 UTC by Ken Arromdee
Modified: 2020-11-08 21:41 UTC (History)
3 users (show)

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


Attachments
example (90.00 KB, application/x-tar)
2020-10-23 23:04 UTC, Ken Arromdee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Arromdee 2020-10-22 22:36:30 UTC
SUMMARY
k3b silently drops files whose names contain special characters when adding to project


STEPS TO REPRODUCE
1. Add a directory full of files to a data project.  The directory contains a file with \367 (M-q) in the filename.
2. Check and see which files k3b actually added to the project by expanding the directory in the left part of the data tab.

OBSERVED RESULT
The file was not added.

EXPECTED RESULT
The file should be added, or at least an error should be produced.

At this point I have no idea how much data I have already lost because of this behavior.  I only discovered that this was happening because of a fluke.

If you try adding only the individual file, k3b will at least produce an error saying that it can't find the file, although it really should be able to.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System) -- I am not using a full desktop environment, only fvwm2, so no About System.  This bug is not related to a graphical environment anyway.

May also be related to bug #282390.
Comment 1 Albert Astals Cid 2020-10-22 22:44:00 UTC
would you be able to attach  a tar with files like that to make it easier for us to reproduce the issue?
Comment 2 Ken Arromdee 2020-10-23 23:04:07 UTC
Created attachment 132675 [details]
example

Tar archive containing two identical files, one with a name containing a special character.  When adding the directory in k3b, only the file without the special character is added and the other is silently dropped.
Comment 3 Albert Astals Cid 2020-10-24 18:03:27 UTC
ok, can reproduce
Comment 4 Bug Janitor Service 2020-10-24 22:46:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/k3b/-/merge_requests/3
Comment 5 Albert Astals Cid 2020-11-08 21:40:45 UTC
Git commit 22b1d0939a3e0bb944b0efaeaac15553b7b36066 by Albert Astals Cid.
Committed on 08/11/2020 at 21:40.
Pushed by aacid into branch 'master'.

Warn when trying to add folders that contain unsupported filenames

In Qt anything that is not propertly utf8 is transparently not returned,
i.e. QDir will simply pretend the file doesn't exist.

This isn't ideal since people may be asuming a backup is totally done
since no error was reported and one file was not really copied.

This doesn't fix the fact that the file is not copied but at least warns
the file could not by found.

It does so by using KIO::listDir instead of QDir

M  +10   -3    src/projects/k3bdataurladdingdialog.cpp

https://invent.kde.org/multimedia/k3b/commit/22b1d0939a3e0bb944b0efaeaac15553b7b36066
Comment 6 Albert Astals Cid 2020-11-08 21:41:39 UTC
Git commit b77897355ecbccb8492b7ee953dd147df4fb699f by Albert Astals Cid.
Committed on 08/11/2020 at 21:41.
Pushed by aacid into branch 'release/20.12'.

Warn when trying to add folders that contain unsupported filenames

In Qt anything that is not propertly utf8 is transparently not returned,
i.e. QDir will simply pretend the file doesn't exist.

This isn't ideal since people may be asuming a backup is totally done
since no error was reported and one file was not really copied.

This doesn't fix the fact that the file is not copied but at least warns
the file could not by found.

It does so by using KIO::listDir instead of QDir
(cherry picked from commit 22b1d0939a3e0bb944b0efaeaac15553b7b36066)

M  +10   -3    src/projects/k3bdataurladdingdialog.cpp

https://invent.kde.org/multimedia/k3b/commit/b77897355ecbccb8492b7ee953dd147df4fb699f