Skip to content

A fiber to execute ':heder_converters' has been changed since v3.2.6 #285

@niku

Description

@niku

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions