Content-Length: 297686 | pFad | https://github.com/python/cpython/issues/113785

4F CSV reader inconsistent with combination of QUOTE_NONNUMERIC and escapechar · Issue #113785 · python/cpython · GitHub
Skip to content

CSV reader inconsistent with combination of QUOTE_NONNUMERIC and escapechar #113785

@serhiy-storchaka

Description

@serhiy-storchaka
>>> next(csv.reader([r'2\.5'], escapechar='\\', quoting=csv.QUOTE_NONNUMERIC))
[2.5]
>>> next(csv.reader([r'.5'], escapechar='\\', quoting=csv.QUOTE_NONNUMERIC))
[0.5]
>>> next(csv.reader([r'\.5'], escapechar='\\', quoting=csv.QUOTE_NONNUMERIC))
['.5']

It parses numbers with an escaped character in the middle, it parses numbers starting with a dot, but it does not parse numbers starting with an escaped character. The following variants would be more consistent:

  1. Any escaped character disables parsing field as a number.
  2. Allow parsing a field starting with an escaped character as a number.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/113785

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy