[ python-Bugs-1157169 ] csv Sniffer returns bad dialect?

SourceForge.net noreply at sourceforge.net
Wed Dec 28 17:00:28 CET 2005


Bugs item #1157169, was opened at 2005-03-05 02:14
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1157169&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Neil Schemenauer (nascheme)
>Assigned to: Skip Montanaro (montanaro)
Summary: csv Sniffer returns bad dialect?

Initial Comment:

>>> d = csv.Sniffer().sniff('abc', ['\t', ','])
>>> csv.reader(['abc'], d)       
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: bad argument type for built-in operation

If the 'delimiters' argument to sniff() is left out
then the TypeError is not raised.  Not sure what's
going on here.

A few other nits:

sniff() seems to be misdocumented.  It cannot return None.

What's the point of the Sniff class?  Why isn't sniff()
a module level function?

The library manual does not state what the iterator
returned by reader() returns.  It should state that
generates lists of strings.

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

>Comment By: Skip Montanaro (montanaro)
Date: 2005-12-28 10:00

Message:
Logged In: YES 
user_id=44345

Somewhere along the way the sniff() docs apparently got fixed.  The Sniff
class has two methods, at least at this point.  It does, in theory, also hide
a couple helper methods as well.  I'll look into the other problems.

Skip


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

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


More information about the Python-bugs-list mailing list