mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-67230: add quoting rules to csv module (GH-29469)
Add two quoting styles for csv dialects. They will help to work with certain databases in particular. Automerge-Triggered-By: GH:merwok
This commit is contained in:
parent
2b6e877767
commit
330a942b63
5 changed files with 43 additions and 3 deletions
|
@ -187,6 +187,10 @@ class Test_Csv(unittest.TestCase):
|
|||
quoting = csv.QUOTE_ALL)
|
||||
self._write_test(['a\nb',1], '"a\nb","1"',
|
||||
quoting = csv.QUOTE_ALL)
|
||||
self._write_test(['a','',None,1], '"a","",,1',
|
||||
quoting = csv.QUOTE_STRINGS)
|
||||
self._write_test(['a','',None,1], '"a","",,"1"',
|
||||
quoting = csv.QUOTE_NOTNULL)
|
||||
|
||||
def test_write_escape(self):
|
||||
self._write_test(['a',1,'p,q'], 'a,1,"p,q"',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue