[ python-Bugs-956246 ] csv.writer refuses a variable parameter

SourceForge.net noreply at sourceforge.net
Tue May 18 17:12:00 EDT 2004


Bugs item #956246, was opened at 2004-05-18 23:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=956246&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Xavier BASSERY (balthus)
Assigned to: Nobody/Anonymous (nobody)
Summary: csv.writer refuses a variable parameter

Initial Comment:

Hi, 
I've reproduced that bug on both the win client and the
cygwin build (windows 2000).

When i do a call on writer like this :
cvsWriter = csv.writer(pseudoFichier, 'excel',
delimiter=delimiteur)

with delimiteur being a variable == ';' ,
       pseudoFichier : a cStringIO

I get that error message :

    cvsWriter = csv.writer(pseudoFichier, 'excel',
delimiter=delimiteur)
TypeError: bad argument type for built-in operation

A way to fix it is to replace the variable delimiteur
with it's value, so 

cvsWriter = csv.writer(pseudoFichier, 'excel',
delimiter=';')

works like a bliss !

I've tried to look at the source of csv.py just to see
that the method that i wanted to see is imported from a
c library (_csv.lib).
I'm not strong enough to look further.
I hope someone here will be able to find the reason of
what seems to be a bug.

Greetings,
Xavier


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=956246&group_id=5470



More information about the Python-bugs-list mailing list