Bug 326884 - kmail removes final newline when saving .csv attachment
Summary: kmail removes final newline when saving .csv attachment
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-30 14:46 UTC by Joachim Wagner
Modified: 2017-01-09 10:24 UTC (History)
0 users

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 Joachim Wagner 2013-10-30 14:46:39 UTC
Observed in KDE / Kontact 4.8.5 r2: Saving a .csv attachment produces a file 1 byte smaller than the original. The missing byte is the last newline.

While entering the bug, I remember having a virtual machine with KDE 4.11.2 and the bug does not occur there. I submit the bug report anyway so that people know that it may be fixed in a more recent KDE.

Reproducible: Always

Steps to Reproduce:
1. create a test file, for example "echo test > test.csv"
2. attach test.csv to an e-mail (leaving attachment properties to default: type text/csv, encoding: 7bit)
3. receive e-mail
4. right click on attachment at end of e-mail and choose "save", for example as test-v2.csv
5. compare files with "diff" and "cmp"
Actual Results:  
diff: No newline at end of file
cmp: EOF on test-v2.csv

Expected Results:  
diff: no output (no difference)
cmp: no output (no difference)

(1) All newlines involved (including newlines in the mbox file if saving the full message) are just 0x0a. No CR LF newlines.

(2) Reproduced with a real-world .csv file, head and tail of the latter file and the 1-line "echo test" test.csv file on 4.8.5 r2.

Workaround: "echo >>test-v2.csv" after saving adds the missing newline.
Comment 1 Denis Kurz 2016-09-24 18:00:54 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 2 Denis Kurz 2017-01-07 22:41:39 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.
Comment 3 Joachim Wagner 2017-01-09 10:24:35 UTC
As explained in the 2nd paragraph of the initial report, the bug was already fixed in 4.11.2 and the purpose of the report was to document a workaround for other people running into this bug with older versions.

I can confirm that the bug is also not present in KMail5 16.08.