[#92070] [Ruby trunk Feature#15667] Introduce malloc_trim(0) in full gc cycles — sam.saffron@...
Issue #15667 has been updated by sam.saffron (Sam Saffron).
3 messages
2019/04/01
[ruby-core:92293] [Ruby trunk Bug#15770] CSV skip_lines param affects data
From:
skyksandr@...
Date:
2019-04-15 11:21:20 UTC
List:
ruby-core #92293
Issue #15770 has been reported by skyksandr (Aleksandr Kunin).
----------------------------------------
Bug #15770: CSV skip_lines param affects data
https://bugs.ruby-lang.org/issues/15770
* Author: skyksandr (Aleksandr Kunin)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.6.*
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
It works on 2.5.\*, but doesn't work on 2.6.\*
```
require 'csv'
require 'date'
counter = 0
CSV.foreach('./05-31-20.CSV', skip_lines: /^[^0-9]{4}/) do |row|
time = row[0]
p time if time.length < 23
counter += 1
end
p "Processed: #{counter} lines"
```
And the result is:
```
"03-09T09:40:04.00Z"
"Processed: 4424 lines"
```
So there are two problems:
1. Line 4424 got corrupted by slicing 5 symbols ("2019-")
2. Not whole file is parsed, total number of lines: **4497**
---Files--------------------------------
05-31-20.CSV (491 KB)
bug.rb (515 Bytes)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>