Author vajrasky
Recipients Thibault.Kruse, ezio.melotti, r.david.murray, serhiy.storchaka, vajrasky
Date 2013-09-08.15:39:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
After contemplating for a while, I am not sure that we should treat empty string for delimiter with error message: '"delimiter" must be an 1-character string'.

The reason is to keep consistency with quotechar keyword.

[sky@localhost cpython]$ ./python -c 'import csv; reader = csv.reader("foo", quotechar="")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: quotechar must be set if quoting enabled

[sky@localhost cpython]$ ./python -c 'import csv; reader = csv.reader("foo", quotechar="", quoting=csv.QUOTE_NONE)'
# No error, so implicitly quotechar is not set, but it is okay since we use "quote none" quoting.
# In other word, quotechar is not set by giving empty string to quotechar.

We could not change the behaviour of csv module, which is unsetting quotechar by giving empty string to quotechar and let it be if we use "quote none" quoting, to preserve backward compatibility.

So the error message should be, "The delimiter must be set" for empty string for delimiter, I suppose.
Date User Action Args
2013-09-08 15:39:49vajraskysetrecipients: + vajrasky, ezio.melotti, r.david.murray, serhiy.storchaka, Thibault.Kruse
2013-09-08 15:39:49vajraskysetmessageid: <>
2013-09-08 15:39:49vajraskylinkissue18829 messages
2013-09-08 15:39:48vajraskycreate