-
Notifications
You must be signed in to change notification settings - Fork 122
Closed as not planned
Closed as not planned
Copy link
Description
I run into an unexpected behavior when I use fiber local variable in heder_converters block.
To reproduce following:
~/csv (tags/v3.2.6)
git checkout v3.2.5
HEAD is now at 502197b Add 3.2.5 entry
~/csv (tags/v3.2.5)
bundle exec ruby -r csv -e 'p CSV::VERSION; main_fiber = Fiber.current; Thread.current[:a]="a"; CSV.new("id,name,age\n1,2,3\n", headers: true, header_converters: ->(h) { p [Fiber.current == main_fiber, Thread.current[:a]] }).to_a;'
"3.2.5"
[true, "a"]
[true, "a"]
[true, "a"]
~/csv (tags/v3.2.5)
git checkout v3.2.6
Previous HEAD position was 502197b Add 3.2.5 entry
HEAD is now at 816b48b Add 3.2.6 entry
~/csv (tags/v3.2.6)
bundle exec ruby -r csv -e 'p CSV::VERSION; main_fiber = Fiber.current; Thread.current[:a]="a"; CSV.new("id,name,age\n1,2,3\n", headers: true, header_converters: ->(h) { p [Fiber.current == main_fiber, Thread.current[:a]] }).to_a;'
"3.2.6"
[false, nil]
[false, nil]
[false, nil]
I suppose it may not a bug. If so, feel free to close it.
Thanks.
Metadata
Metadata
Assignees
Labels
No labels