[Python-3000-checkins] r59181 - python/branches/py3k/Modules/_csv.c

Georg Brandl g.brandl at gmx.net
Tue Nov 27 21:42:36 CET 2007


Guido van Rossum schrieb:
> On Nov 24, 2007 4:52 PM, georg.brandl <python-3000-checkins at python.org> wrote:
>> Modified: python/branches/py3k/Modules/_csv.c
>> ==============================================================================
>> --- python/branches/py3k/Modules/_csv.c (original)
>> +++ python/branches/py3k/Modules/_csv.c Sun Nov 25 01:52:21 2007
>> @@ -793,14 +793,13 @@
>>                                              "newline inside string");
>>                          return NULL;
>>                  }
>> -               if (!PyUnicode_Check(lineobj))
>> -               {
>> -                       PyErr_Format(error_obj,
>> -                                    "Iterator should return strings, "
>> -                                    "not %.200s "
>> -                                    "(did you open the file in text mode?)",
>> +               if (!PyUnicode_Check(lineobj)) {
>> +                       PyErr_Format(error_obj, "iterator should return "
>> +                                    "strings, not %.200s (did you open "
>> +                                    "the file in text mode?)",
> 
> To be honest, I liked the way the long string literal was broken
> across lines before better. Breaking at punctuation makes it more
> likely that grepping through the source for a fragment of an error
> message will yield a hit. And sometimes, when faced with a mysterious
> error message, there's no substitute for grepping... :-)

Agreed. Fixed in r59198.

Georg



More information about the Python-3000-checkins mailing list