Skip to content

Read StringIO with foreach #300

@MarcPer

Description

@MarcPer

Proposal

I'd like to propose being able to open a StringIO s with CSV.foreach(s), just as it's possible to open a file with CSV.foreach(path).

I can investigate and open a PR if this behavior is desired.

Current behavior

The documentation already says it should be possible to pass an IO object to foreach, but if an instance of StringIO is passed, we get:

no implicit conversion of StringIO into String (TypeError)

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