[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Éric Araujo
Éric Araujo added the comment: Thank you for the report. The problem is that asserTrue is used instead of assertEqual; attached patch fixes that and reveals a bug. -- components: +Library (Lib) nosy: +eric.araujo stage: -> needs patch title: csv test_register_kwargs has invalid messa

[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Éric Araujo
Éric Araujo added the comment: This is the output of the test: FAIL: test_register_kwargs (__main__.TestDialectRegistry) -- Traceback (most recent call last): File "Lib/test/test_csv.py", line 326, in test_register_kwargs

[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Alex Earl
Alex Earl added the comment: The internal _csv module which actually implements the reader method expects the first parameter to be an iterable object. Since strings are iterated by character, that is why this is occuring. So, the fix would need to be made in the _csv module, which is a C mod

[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Éric Araujo
Changes by Éric Araujo : Removed file: http://bugs.python.org/file19904/fix-test.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Éric Araujo
Éric Araujo added the comment: I still think this is a bug in the test. Attached patch fixes it. -- assignee: -> eric.araujo Added file: http://bugs.python.org/file19905/fix-test.diff ___ Python tracker

[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Alex Earl
Alex Earl added the comment: The patch looks good to me. The only question I have is that the previous test that was passing a string, is the expected behavior what was being returned before, or would it be useful to turn the string into an iterable over "lines"? -- _

[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Éric Araujo
Éric Araujo added the comment: I don’t think we should change behavior. Strings are iterable; csv.reader takes an iterable; this is sensible and documented. See http://docs.python.org/dev/library/csv#csv.reader and the last example of http://docs.python.org/dev/library/csv#examples ---

[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Alex Earl
Alex Earl added the comment: Excellent. As long as it's documented, it works for me. -- ___ Python tracker ___ ___ Python-bugs-list m

[issue10602] Wrong assert* method in test_csv.test_register_kwargs masks error

2010-12-02 Thread Éric Araujo
Éric Araujo added the comment: Patch committed as r86940 (py3k), r86941 (3.1) and r86942 (2.7). -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker _