This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: csv Sniffer returns bad dialect?
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: skip.montanaro Nosy List: nascheme, skip.montanaro
Priority: normal Keywords:

Created on 2005-03-05 08:14 by nascheme, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg24472 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-03-05 08:14
>>> 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.
msg24473 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2005-12-28 16:00
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
msg84136 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-03-25 00:51
I'm closing this.  It's my own fault that it languished for so long,
but the current trunk version of Python doesn't demonstrate the behavior
Neil documented four years ago.
msg84139 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-03-25 01:02
(I did try to clarify the return value of the next/__next__ method a bit.)
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41655
2009-03-25 01:02:20skip.montanarosetmessages: + msg84139
2009-03-25 00:51:17skip.montanarosetstatus: open -> closed
resolution: out of date
messages: + msg84136
2009-03-20 21:46:08ajaksu2setstage: test needed
type: behavior
versions: + Python 2.6
2005-03-05 08:14:28naschemecreate