GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Csv sniffer doesn't attempt to determine and set escape character. · Issue #83273 · python/cpython

Csv sniffer doesn't attempt to determine and set escape character. #83273

New issue
Copy link
New issue
Copy link
Closed
#153694
Closed
Csv sniffer doesn't attempt to determine and set escape character.#83273
#153694
Copy link
Assignees
serhiy-storchaka
Labels
3.16new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

evanw2
mannequin
opened on Dec 18, 2019
Issue body actions
BPO 39092
Nosy @evanw2

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2019-12-18.20:50:42.912>
labels = ['type-bug', 'library', '3.9']
title = "Csv sniffer doesn't attempt to determine and set escape character."
updated_at = <Date 2019-12-18.20:50:42.912>
user = 'https://github.com/evanw2'

bugs.python.org fields:

activity = <Date 2019-12-18.20:50:42.912>
actor = 'evan.whitfield'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2019-12-18.20:50:42.912>
creator = 'evan.whitfield'
dependencies = []
files = []
hgrepos = []
issue_num = 39092
keywords = []
message_count = 1.0
messages = ['358645']
nosy_count = 1.0
nosy_names = ['evan.whitfield']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue39092'
versions = ['Python 3.9']

Linked PRs

  • gh-83273: Rewrite csv.Sniffer dialect detection using trial parsing #153694

Activity

  1. evanw2 commented on Dec 18, 2019

    @evanw2
    evanw2mannequin
    on Dec 18, 2019
    MannequinAuthor
    More actions

    I observed a false positive for the csv sniffer has_header method. (It thought there was a header when there was not.) This is due to the fact that in has_header, it determines the csv dialect by sniffing it, and failed to determine that the file I was using had an escape character of '\'. Since it doesn't set the escape character, it then incorrectly broke the first line of the file into columns, since it encountered an escaped quote within a quoted column, and treated that as the end of that column. (It correctly determined that the dialect wasn't doublequote, but apparently still needs to have the escape character set to handle an escaped quotechar.)

    I think one (or both) of these things should be done here to avoid this false positive:
    1.) Allow a dialect to be passed to has_header, so that someone could specify the escape character of the dialect if it were known.
    2.) Allow the sniff method of the Sniffer class to detect and set the escapechar.

  2. evanw2
    added
    3.9 (EOL)end of lifeend of life
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Dec 18, 2019
  3. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  4. serhiy-storchaka
    added this to CSV issues 📊on May 19, 2022
  5. serhiy-storchaka
    self-assigned this
    on Jan 9, 2024
  6. serhiy-storchaka
    added a commit that references this issue on Jul 21, 2026

    gh-83273: Rewrite csv.Sniffer dialect detection using trial parsing (G…

    25fea6d
  7. serhiy-storchaka
    closed this as completedin #153694on Jul 21, 2026
  8. github-project-automation
    moved this to Done in CSV issues 📊on Jul 21, 2026
  9. serhiy-storchaka
    added
    3.16new features, bugs and security fixesnew features, bugs and security fixes
    and removed
    3.9 (EOL)end of lifeend of life
    on Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @serhiy-storchaka
    serhiy-storchaka

Labels

3.16new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

  • CSV issues 📊
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.