mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Fix parsing of csv files with escapes (escape character previously would be
left in stream).
This commit is contained in:
parent
41e4faa82b
commit
36a7691c2d
2 changed files with 2 additions and 10 deletions
|
@ -227,10 +227,10 @@ class Test_Csv(unittest.TestCase):
|
|||
self.assertRaises(csv.Error, self._read_test, ['a,b\r\nc,d'], [])
|
||||
|
||||
def test_read_escape(self):
|
||||
self._read_test(['a,\\b,c'], [['a', '\\b', 'c']], escapechar='\\')
|
||||
self._read_test(['a,\\b,c'], [['a', 'b', 'c']], escapechar='\\')
|
||||
self._read_test(['a,b\\,c'], [['a', 'b,c']], escapechar='\\')
|
||||
self._read_test(['a,"b\\,c"'], [['a', 'b,c']], escapechar='\\')
|
||||
self._read_test(['a,"b,\\c"'], [['a', 'b,\\c']], escapechar='\\')
|
||||
self._read_test(['a,"b,\\c"'], [['a', 'b,c']], escapechar='\\')
|
||||
self._read_test(['a,"b,c\\""'], [['a', 'b,c"']], escapechar='\\')
|
||||
self._read_test(['a,"b,c"\\'], [['a', 'b,c\\']], escapechar='\\')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue