Index: test_csv.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_csv.py,v retrieving revision 1.28 diff -c -r1.28 test_csv.py *** test_csv.py 20 Apr 2005 19:41:24 -0000 1.28 --- test_csv.py 30 Jun 2005 23:06:11 -0000 *************** *** 249,254 **** --- 249,260 ---- ['abc,3'], [[]], quoting=csv.QUOTE_NONNUMERIC) + def test_read_comments(self): + self._read_test(['a,b,c'], [['a', 'b', 'c']], commentchar='#') + self._read_test(['#a,b,c'], [], commentchar='#') + self._read_test([';a,b,c'], [], commentchar=';') + self._read_test([' #a,b,c'], [[' #a','b','c']], commentchar='#') + def test_read_bigfield(self): # This exercises the buffer realloc functionality and field size # limits. *************** *** 420,425 **** --- 426,432 ---- self.assertRaises(TypeError, csv.reader, [], delimiter = None) self.assertRaises(TypeError, csv.reader, [], quoting = -1) self.assertRaises(TypeError, csv.reader, [], quoting = 100) + self.assertRaises(TypeError, csv.reader, [], commentchar = ' ') class TestCsvBase(unittest.TestCase): def readerAssertEqual(self, input, expected_result): Index: libcsv.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcsv.tex,v retrieving revision 1.19 diff -c -r1.19 libcsv.tex *** libcsv.tex 18 Mar 2005 16:56:37 -0000 1.19 --- libcsv.tex 30 Jun 2005 23:07:42 -0000 *************** *** 263,268 **** --- 263,276 ---- Dialects support the following attributes: + \begin{memberdesc}[Dialect]{commentchar} + A one-character string denoting comment lines. If the first character on a + line is \var{commentchar}, the \class{reader} will skip that line; it has no + effect on the \class{writer}. An \exception{Error} is raised if + \var{commentchar} is \code{' '} (a space). It defaults to \constant{None}, + meaning no lines will be ignored. + \end{memberdesc} + \begin{memberdesc}[Dialect]{delimiter} A one-character string used to separate fields. It defaults to \code{','}. \end{memberdesc}