ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:91521] [Ruby trunk Bug#15600] CSV underlying IO object is not gettingrewound after parsing
       [not found] <redmine.issue-15600.20190212235259@ruby-lang.org>
@ 2019-02-12 23:53 ` chiting.leung
  2019-02-13  2:53 ` [ruby-core:91525] [Ruby trunk Bug#15600] CSV underlying IO object is not getting rewound " nobu
  2019-02-13 10:01 ` [ruby-core:91529] " chiting.leung
  2 siblings, 0 replies; 3+ messages in thread
From: chiting.leung @ 2019-02-12 23:53 UTC (permalink / raw
  To: ruby-core

Issue #15600 has been reported by chi (Chi Leung).

----------------------------------------
Bug #15600: CSV underlying IO object is not getting rewound after parsing
https://bugs.ruby-lang.org/issues/15600

* Author: chi (Chi Leung)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin16]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Hello,

Sorry if this bug has already been reported but I couldn't find any reference to it.

For the following CSV test.csv file:
```
a,b,c,d
1,2,3,4
5,6,7,8
9,10,11,12
```

and the following code snippet:
``` ruby
require 'csv'
csv = ::CSV.open('./test.csv', {headers: true, col_sep: ','})
p csv.eof?
csv.readline
p csv.eof?
csv.readline
p csv.eof?
csv.readline
p csv.eof?

```

I got the following results with 2.6.1:
```
false
true
true
true
```

but using `ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin16]` I got:
```
false
false
false
true
```

It might be an intentional behaviour but in that case, I can't see anything in the documentation explicitly saying that we shouldn't rely on the underlying IO object to know the state of the current CSV object (as it was possible in the previous minor version) and couldn't find the related changelog.

Thanks for your work.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:91525] [Ruby trunk Bug#15600] CSV underlying IO object is not getting rewound after parsing
       [not found] <redmine.issue-15600.20190212235259@ruby-lang.org>
  2019-02-12 23:53 ` [ruby-core:91521] [Ruby trunk Bug#15600] CSV underlying IO object is not gettingrewound after parsing chiting.leung
@ 2019-02-13  2:53 ` nobu
  2019-02-13 10:01 ` [ruby-core:91529] " chiting.leung
  2 siblings, 0 replies; 3+ messages in thread
From: nobu @ 2019-02-13  2:53 UTC (permalink / raw
  To: ruby-core

Issue #15600 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Third Party's Issue

> It might be an intentional behaviour but in that case, I can't see anything in the documentation explicitly saying that we shouldn't rely on the underlying IO object to know the state of the current CSV object (as it was possible in the previous minor version) and couldn't find the related changelog.

You can report this to [the upstream of CSV](https://github.com/ruby/csv).
I guess it has never guaranteed such assumption, though.


----------------------------------------
Bug #15600: CSV underlying IO object is not getting rewound after parsing
https://bugs.ruby-lang.org/issues/15600#change-76786

* Author: chi (Chi Leung)
* Status: Third Party's Issue
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin16]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Hello,

Sorry if this bug has already been reported but I couldn't find any reference to it.

For the following CSV test.csv file:
```
a,b,c,d
1,2,3,4
5,6,7,8
9,10,11,12
```

and the following code snippet:
``` ruby
require 'csv'
csv = ::CSV.open('./test.csv', {headers: true, col_sep: ','})
p csv.eof?
csv.readline
p csv.eof?
csv.readline
p csv.eof?
csv.readline
p csv.eof?

```

I got the following results with 2.6.1:
```
false
true
true
true
```

but using `ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin16]` I got:
```
false
false
false
true
```

It might be an intentional behaviour but in that case, I can't see anything in the documentation explicitly saying that we shouldn't rely on the underlying IO object to know the state of the current CSV object (as it was possible in the previous minor version) and couldn't find the related changelog.

Thanks for your work.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:91529] [Ruby trunk Bug#15600] CSV underlying IO object is not getting rewound after parsing
       [not found] <redmine.issue-15600.20190212235259@ruby-lang.org>
  2019-02-12 23:53 ` [ruby-core:91521] [Ruby trunk Bug#15600] CSV underlying IO object is not gettingrewound after parsing chiting.leung
  2019-02-13  2:53 ` [ruby-core:91525] [Ruby trunk Bug#15600] CSV underlying IO object is not getting rewound " nobu
@ 2019-02-13 10:01 ` chiting.leung
  2 siblings, 0 replies; 3+ messages in thread
From: chiting.leung @ 2019-02-13 10:01 UTC (permalink / raw
  To: ruby-core

Issue #15600 has been updated by chi (Chi Leung).


Hi nobu, thanks for your reply.

> I guess it has never guaranteed such assumption, though.

Sorry, what I meant is that I don't understand why `#eof?` would be exposed as a method if it doesn't reflect the state of the current object anymore and was never meant to do.

I will raise a ticket on the upstream repository.

----------------------------------------
Bug #15600: CSV underlying IO object is not getting rewound after parsing
https://bugs.ruby-lang.org/issues/15600#change-76789

* Author: chi (Chi Leung)
* Status: Third Party's Issue
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin16]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Hello,

Sorry if this bug has already been reported but I couldn't find any reference to it.

For the following CSV test.csv file:
```
a,b,c,d
1,2,3,4
5,6,7,8
9,10,11,12
```

and the following code snippet:
``` ruby
require 'csv'
csv = ::CSV.open('./test.csv', {headers: true, col_sep: ','})
p csv.eof?
csv.readline
p csv.eof?
csv.readline
p csv.eof?
csv.readline
p csv.eof?

```

I got the following results with 2.6.1:
```
false
true
true
true
```

but using `ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin16]` I got:
```
false
false
false
true
```

It might be an intentional behaviour but in that case, I can't see anything in the documentation explicitly saying that we shouldn't rely on the underlying IO object to know the state of the current CSV object (as it was possible in the previous minor version) and couldn't find the related changelog.

Thanks for your work.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-13 10:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-15600.20190212235259@ruby-lang.org>
2019-02-12 23:53 ` [ruby-core:91521] [Ruby trunk Bug#15600] CSV underlying IO object is not gettingrewound after parsing chiting.leung
2019-02-13  2:53 ` [ruby-core:91525] [Ruby trunk Bug#15600] CSV underlying IO object is not getting rewound " nobu
2019-02-13 10:01 ` [ruby-core:91529] " chiting.leung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).