Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_csv.Dialect() does not check type for delimiter, escapechar and quotechar fields #64222

Closed
vstinner opened this issue Dec 19, 2013 · 3 comments

Comments

@vstinner
Copy link
Member

BPO 20023
Nosy @vstinner, @serhiy-storchaka, @vajrasky
Superseder
  • bpo-18829: csv produces confusing error message when passed a non-string delimiter
  • Files
  • csv.patch
  • 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 = <Date 2013-12-19.15:46:01.106>
    created_at = <Date 2013-12-19.10:05:52.691>
    labels = []
    title = '_csv.Dialect() does not check type for delimiter, escapechar and quotechar fields'
    updated_at = <Date 2013-12-19.15:46:01.105>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2013-12-19.15:46:01.105>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-12-19.15:46:01.106>
    closer = 'vstinner'
    components = []
    creation = <Date 2013-12-19.10:05:52.691>
    creator = 'vstinner'
    dependencies = []
    files = ['33203']
    hgrepos = []
    issue_num = 20023
    keywords = ['patch']
    message_count = 3.0
    messages = ['206593', '206597', '206598']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'serhiy.storchaka', 'vajrasky']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '18829'
    type = None
    url = 'https://bugs.python.org/issue20023'
    versions = ['Python 3.4']

    @vstinner
    Copy link
    Member Author

    Example:

    $ ./python -c "import _csv; _csv.Dialect(escapechar=b'x')"
    python: Python/ceval.c:4262: call_function: Assertion `(x != ((void *)0) && !PyErr_Occurred()) || (x == ((void *)0) && PyErr_Occurred())' failed.
    Abandon (core dumped)

    Attached patch should fix this issue and adds a unit test.

    Note: I found this issue using Fusil the fuzzer.

    @vajrasky
    Copy link
    Mannequin

    vajrasky mannequin commented Dec 19, 2013

    Bear in the mind, the bug is only reproducible with debug flag (--with-pydebug).

    Victor, we have a more complete solution for this problem in bpo-18829.

    @serhiy-storchaka
    Copy link
    Member

    This is a duplicate of bpo-18829.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants