New submission from Vajrasky Kok: Python 3.4.0b1 (default:13a505260f17, Dec 20 2013, 12:02:44) [GCC 4.7.2] on linux >>> import _csv >>> import csv >>> _csv.Dialect(quotechar=b'+') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: "quotechar" must be string, not bytes
Hey, that's not true. Quotechar can be None. >>> _csv.Dialect(quotechar=None) <_csv.Dialect object at 0x7f64a8534790> >>> _csv.Dialect(quotechar="cutecat") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: "quotechar" must be an 1-character string That's not strictly true. Quotechar can be 0-character string in certain situation. >>> _csv.Dialect(quotechar="", quoting=csv.QUOTE_NONE) <_csv.Dialect object at 0x7f64a85345f0> Python 2.7 suffers the same issue. ---------- components: Library (Lib) messages: 206663 nosy: r.david.murray, serhiy.storchaka, vajrasky priority: normal severity: normal status: open title: Confusing error message when giving invalid quotechar in initializing csv dialect type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20028> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com