<p>It is true, the fix may belong in CSV. I am recovering from my tendencies to go through contortions to work around issues that I could be solving at their source.</p>
<p>Does CSV use line/unlines under the hood? I have heard that these do not perfectly round-trip.</p>
<p>Antoine</p>
<div class="gmail_quote">On Nov 8, 2010 1:33 AM, "Joachim Breitner" <<a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a>> wrote:<br type="attribution">> Hi,<br>> <br>> Am Sonntag, den 07.11.2010, 19:52 +0100 schrieb Antoine Latter:<br>
>> On Sun, Nov 7, 2010 at 10:43 AM, Joachim Breitner<br>>> <<a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a>> wrote:<br>>> > Hi Jaap,<br>>> ><br>>> > your CSV library is used in the Hackage2 project. I found that backup<br>
>> > and restore does not work with a pristine state, and the reason seems to<br>>> > be a problem with your library: It either adds unnecessary newlines or<br>>> > interprets empty lines at the end of the program for no apparent reason:<br>
>> ><br>>> > Prelude Text.CSV> (parseCSV "name" . printCSV) []<br>>> > Right [[""]]<br>>> > Prelude Text.CSV> (parseCSV "name" . printCSV) [[]]<br>>> > Right [[""],[""]]<br>
>> > Prelude Text.CSV> (parseCSV "name" . printCSV) [[],[]]<br>>> > Right [[""],[""]]<br>>> > Prelude Text.CSV> (parseCSV "name" . printCSV) [["hi"],["ho"]]<br>
>> > Right [["hi"],["ho"],[""]]<br>>> > Prelude Text.CSV> (parseCSV "name" . printCSV) [["hi"]]<br>>> > Right [["hi"],[""]]<br>
>> > Prelude Text.CSV><br>>> ><br>>> <br>>> At some point I had a hack in place to drop the last row of a parsed<br>>> CSV file if it was nothing but an empty string. It may have gotten<br>
>> lost, or it may not be universally applied in hackage-server 2. This<br>>> worked pretty well for most things, but I don't think I ever ran into<br>>> the issue of an empty line in the middle of a CSV file.<br>
> <br>> correct, I later found that code as well. I’m not fully anymore that the<br>> issues I observed are caused by this bug. But nevertheless it’s better<br>> to fix the CSV module than work around it in hackage2.<br>
> <br>> Greetings,<br>> Joachim<br>> <br>> -- <br>> Joachim "nomeata" Breitner<br>> mail: <a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a> | ICQ# 74513189 | GPG-Key: 4743206C<br>
> JID: <a href="mailto:nomeata@joachim-breitner.de">nomeata@joachim-breitner.de</a> | <a href="http://www.joachim-breitner.de/">http://www.joachim-breitner.de/</a><br>> Debian Developer: <a href="mailto:nomeata@debian.org">nomeata@debian.org</a><br>
</div>