<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, &quot;Joachim Breitner&quot; &lt;<a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a>&gt; wrote:<br type="attribution">&gt; Hi,<br>&gt; <br>&gt; Am Sonntag, den 07.11.2010, 19:52 +0100 schrieb Antoine Latter:<br>
&gt;&gt; On Sun, Nov 7, 2010 at 10:43 AM, Joachim Breitner<br>&gt;&gt; &lt;<a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a>&gt; wrote:<br>&gt;&gt; &gt; Hi Jaap,<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; your CSV library is used in the Hackage2 project. I found that backup<br>
&gt;&gt; &gt; and restore does not work with a pristine state, and the reason seems to<br>&gt;&gt; &gt; be a problem with your library: It either adds unnecessary newlines or<br>&gt;&gt; &gt; interprets empty lines at the end of the program for no apparent reason:<br>
&gt;&gt; &gt;<br>&gt;&gt; &gt; Prelude Text.CSV&gt; (parseCSV &quot;name&quot; . printCSV) []<br>&gt;&gt; &gt; Right [[&quot;&quot;]]<br>&gt;&gt; &gt; Prelude Text.CSV&gt; (parseCSV &quot;name&quot; . printCSV) [[]]<br>&gt;&gt; &gt; Right [[&quot;&quot;],[&quot;&quot;]]<br>
&gt;&gt; &gt; Prelude Text.CSV&gt; (parseCSV &quot;name&quot; . printCSV) [[],[]]<br>&gt;&gt; &gt; Right [[&quot;&quot;],[&quot;&quot;]]<br>&gt;&gt; &gt; Prelude Text.CSV&gt; (parseCSV &quot;name&quot; . printCSV) [[&quot;hi&quot;],[&quot;ho&quot;]]<br>
&gt;&gt; &gt; Right [[&quot;hi&quot;],[&quot;ho&quot;],[&quot;&quot;]]<br>&gt;&gt; &gt; Prelude Text.CSV&gt; (parseCSV &quot;name&quot; . printCSV) [[&quot;hi&quot;]]<br>&gt;&gt; &gt; Right [[&quot;hi&quot;],[&quot;&quot;]]<br>
&gt;&gt; &gt; Prelude Text.CSV&gt;<br>&gt;&gt; &gt;<br>&gt;&gt; <br>&gt;&gt; At some point I had a hack in place to drop the last row of a parsed<br>&gt;&gt; CSV file if it was nothing but an empty string. It may have gotten<br>
&gt;&gt; lost, or it may not be universally applied in hackage-server 2. This<br>&gt;&gt; worked pretty well for most things, but I don&#39;t think I ever ran into<br>&gt;&gt; the issue of an empty line in the middle of a CSV file.<br>
&gt; <br>&gt; correct, I later found that code as well. I’m not fully anymore that the<br>&gt; issues I observed are caused by this bug. But nevertheless it’s better<br>&gt; to fix the CSV module than work around it in hackage2.<br>
&gt; <br>&gt; Greetings,<br>&gt; Joachim<br>&gt; <br>&gt; -- <br>&gt; Joachim &quot;nomeata&quot; Breitner<br>&gt;   mail: <a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a> | ICQ# 74513189 | GPG-Key: 4743206C<br>
&gt;   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>&gt;   Debian Developer: <a href="mailto:nomeata@debian.org">nomeata@debian.org</a><br>
</div>