G
Gabriel Cooper
Is there a known-bug in csv.DictWriter? It is ignoring my attempts to
specify a Dialect. It doesn't even error if you give it anything
invalid. I can send it the registered string-name of the dialect, a
string of gibberish, a dialect object instance, a dialect class
object... it accepts all and ignores all.
Take for example a default-created Dialect, excel-tab:
Python 2.3.3 (#1, Apr 14 2004, 01:02:50)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
csv.DictWriter(open('/root/quickbooks/testout.iif','w'),['a','b'],csv.excel_tab())
csv.DictWriter(open('/root/quickbooks/testout.iif','w'),['a','b'],"no
one is listening")csv.DictWriter(open('/root/quickbooks/testout.iif','w'),['a','b'],csv.excel_tab)
Traceback (most recent call last):
Currently I have to go through and manually set each of the dialect's
attributes individually, like soetc.)
specify a Dialect. It doesn't even error if you give it anything
invalid. I can send it the registered string-name of the dialect, a
string of gibberish, a dialect object instance, a dialect class
object... it accepts all and ignores all.
Take for example a default-created Dialect, excel-tab:
Python 2.3.3 (#1, Apr 14 2004, 01:02:50)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
csv.DictWriter(open('/root/quickbooks/testout.iif','w'),['a','b'],"excel-tab")>>> import csv
>>> csv.list_dialects() ['excel-tab', 'excel']
>>> csv.excel_tab.delimiter '\t'
>>> a =
csv.DictWriter(open('/root/quickbooks/testout.iif','w'),['a','b'],csv.excel_tab())
csv.DictWriter(open('/root/quickbooks/testout.iif','w'),['a','b'],"no
one is listening")csv.DictWriter(open('/root/quickbooks/testout.iif','w'),['a','b'],csv.excel_tab)
Traceback (most recent call last):
Currently I have to go through and manually set each of the dialect's
attributes individually, like soetc.)