Bug in csv or byLine ?

Guillaume Chatelet via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 8 01:59:26 PST 2016


$ cat debug.csv
timestamp,curr_property
2015-12-01 06:07:55,7035
----------------------------------------------------------------
$ cat process.d
import std.stdio;
import std.csv;
import std.algorithm;
import std.file;

void main(string[] args) {
   version (Fail) {
     File(args[1], "r").byLine.joiner("\n").csvReader.each!writeln;
   } else {
     readText(args[1]).csvReader.each!writeln;
   }
}
----------------------------------------------------------------
$ dmd -run ./process.d debug.csv
["timestamp", "curr_property"]
["2015-12-01 06:07:55", "7035"]
----------------------------------------------------------------
$ dmd -version=Fail -run ./process.d debug.csv
["timestamp", "curr_property"]
["2015-12-01 06:07:55", "7035"]
core.exception.AssertError at std/algorithm/iteration.d(2027): 
Assertion failure
----------------
??:? _d_assert [0x4633d3]
??:? void std.algorithm.iteration.__assert(int) [0x46d770]
??:? pure @property @safe dchar 
std.algorithm.iteration.joiner!(std.stdio.File.ByLine!(char, 
char).ByLine, 
immutable(char)[]).joiner(std.stdio.File.ByLine!(char, 
char).ByLine, immutable(char)[]).Result.front() [0x44eaf0]
??:? void std.csv.CsvReader!(immutable(char)[], 1, 
std.algorithm.iteration.joiner!(std.stdio.File.ByLine!(char, 
char).ByLine, 
immutable(char)[]).joiner(std.stdio.File.ByLine!(char, 
char).ByLine, immutable(char)[]).Result, dchar, 
immutable(char)[][]).CsvReader.popFront() [0x44f7fc]
??:? void 
std.algorithm.iteration.__T4eachS183std5stdio7writelnZ.each!(std.csv.CsvReader!(immutable(char)[], 1, std.algorithm.iteration.joiner!(std.stdio.File.ByLine!(char, char).ByLine, immutable(char)[]).joiner(std.stdio.File.ByLine!(char, char).ByLine, immutable(char)[]).Result, dchar, immutable(char)[][]).CsvReader).each(std.csv.CsvReader!(immutable(char)[], 1, std.algorithm.iteration.joiner!(std.stdio.File.ByLine!(char, char).ByLine, immutable(char)[]).joiner(std.stdio.File.ByLine!(char, char).ByLine, immutable(char)[]).Result, dchar, immutable(char)[][]).CsvReader) [0x4608f7]
??:? _Dmain [0x44bc93]


Any idea ?


More information about the Digitalmars-d-learn mailing list