Bug in csv or byLine ?

Keywan Ghadami via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 10 01:41:16 PST 2016


On Friday, 8 January 2016 at 13:53:06 UTC, Guillaume Chatelet 
wrote:
> On Friday, 8 January 2016 at 13:22:40 UTC, Tobi G. wrote:
>> On Friday, 8 January 2016 at 12:13:59 UTC, Guillaume Chatelet 
>> wrote:
>>> On Friday, 8 January 2016 at 12:07:05 UTC, Tobi G. wrote:
>>>> No, sorry. Under Windows DMD v2.069.2 it works perfectly in 
>>>> both cases.
>>>>
>>>> Which compiler do you use?
>>>
>>> - DMD64 D Compiler v2.069.2 on Linux.
>>> - LDC 0.16.1 (DMD v2.067.1, LLVM 3.7.0)
>>
>> I ran it now under Linux/Ubuntu DMD64 D Compiler v2.069.2
>>
>> But both still worked..
>>
>> Are there some characters in your input data which are invalid 
>> and not displayed in the forum?
>> (multiple empty lines after the actual csv data for example)
>>
>> togrue
>
> Indeed there's an empty line at the end of the csv.
>
> Interestingly enough if I try with DMD64 D Compiler v2.069, the 
> Fail version runs fine but the normal version returns:
> std.csv.CSVException@/usr/include/dlang/dmd/std/csv.d(1246): 
> Row 3's length 1 does not match previous length of 2.
I still do not understand half of the syntax(still learning) but 
my guess is that it is a bug in the csv reader:
In 
https://github.com/D-Programming-Language/phobos/blob/67c95e6de21d5d627e3c57128b4d6e332c82f785/std/csv.d line 1020 calls popfront on the input without checking that it input is empty.
But this only happen in special case if the last line is \r\n if 
i understand it correctly.
I might be totally wrong because it does not match your 
stackstrace and i did not yet understand everything about this.


More information about the Digitalmars-d-learn mailing list