Bug 46699 - Try to open CSV empty (with 0 bytes) writes garbage data to file.
Summary: Try to open CSV empty (with 0 bytes) writes garbage data to file.
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.4.4 release
Hardware: Other All
: medium major
Assignee: Eike Rathke
Whiteboard: target:3.6.0
: 51172 (view as bug list)
Depends on:
Reported: 2012-02-27 14:47 UTC by Fco. Javier M. C.
Modified: 2012-06-17 15:29 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Fco. Javier M. C. 2012-02-27 14:47:20 UTC
When you open a 0 bytes CSV file the program ask you for file format. If you say it is a CSV file then opens garbage data. Then if you cancel the import, the file content is 1,5 KB of garbage data.
Comment 1 Urmas 2012-02-28 03:18:22 UTC
It's not a garbage data, it's a compound document.
Comment 2 Jonathan Kamens 2012-03-22 12:21:24 UTC
What's a "compound document"?
Comment 4 Jonathan Kamens 2012-03-26 07:20:54 UTC
Well, that may provide a "dictionary definition" of what a compound document is, but it doesn't change the fact that what the user perceives here is "garbage."

In particular, when the empty CSV file is opened and "Text CSV" is selected as the type for it when prompted, the spreadsheet opens with a row of nonsense, non-ASCII characters in it. If that's the "compound document" meta-data, then LibreOffice is interpreting said metadata incorrectly.

And then if you use Save As... to save the file immediately after it is opened, the saved file has all sorts of garbage in it, instead of it simply being an empty plain-text CSV.

So while the root cause of the issue may very well be that Microsoft compound document code is somehow being executed when it shouldn't be, the fact remains that from the point of view of the end user, there is in fact garbage in the file that shouldn't be there.
Comment 5 Not Assigned 2012-04-04 14:43:35 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":


resolved fdo#46699 do not write compound document header when reading 0-length file
Comment 6 Urmas 2012-06-17 15:29:12 UTC
*** Bug 51172 has been marked as a duplicate of this bug. ***