[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-04-12 Thread Skip Montanaro
Skip Montanaro <[EMAIL PROTECTED]> added the comment: I can't see a great reason to change the behavior. I've attached my current patch for csv.py and test_csv.py in case someone else wants to pick it up later. -- keywords: +patch priority: -> low resolution: -> postponed status: open

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-29 Thread Skip Montanaro
Skip Montanaro <[EMAIL PROTECTED]> added the comment: >> It works entirely based on chracter frequencies. Amaury> Does it make sense to restrict delimiters to a reasonable set of Amaury> characters? Usual punctuations, spaces, tabs... what else? There is an optional delimiters argument

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: > It works entirely based on chracter frequencies. Does it make sense to restrict delimiters to a reasonable set of characters? Usual punctuations, spaces, tabs... what else? -- nosy: +amaury.forgeotdarc __

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-28 Thread Skip Montanaro
Skip Montanaro <[EMAIL PROTECTED]> added the comment: Jean-Philippe> You're right, it does seem that using f.read(1024) to Jean-Philippe> feed the sniffer works OK in my case and allows me to Jean-Philippe> instantiate the DictReader correctly... Why that is I'm Jean-Philippe> not su

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-27 Thread Jean-Philippe Laverdure
Jean-Philippe Laverdure <[EMAIL PROTECTED]> added the comment: Hi Skip, You're right, it does seem that using f.read(1024) to feed the sniffer works OK in my case and allows me to instantiate the DictReader correctly... Why that is I'm not sure though... I was submitting the first line as I th

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-27 Thread Skip Montanaro
Skip Montanaro <[EMAIL PROTECTED]> added the comment: Jean-Philippe> The fact is this code is in use in an application where Jean-Philippe> users can submit a .csv file produced by Excel for Jean-Philippe> treatment. The file must contain a "Sequence" column Jean-Philippe> since that

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-27 Thread Jean-Philippe Laverdure
Jean-Philippe Laverdure <[EMAIL PROTECTED]> added the comment: Hello and sorry for the late reply. Wolfgang: sorry about my misuse of the csv.DictReader constructor, that was a mistake on my part. However, it still is not functionning as I think it should/could. Look at this: Using this conte

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-19 Thread Skip Montanaro
Skip Montanaro <[EMAIL PROTECTED]> added the comment: Wolfgang> In this cases it is not really possible to sniff the right Wolfgang> delimiter. To not allow digits or letters is not a good Wolfgang> solution. I think the behavior as now is ok, and at this time Wolfgang> I see now wa

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-19 Thread Wolfgang Langner
Wolfgang Langner <[EMAIL PROTECTED]> added the comment: In this cases it is not really possible to sniff the right delimiter. To not allow digits or letters is not a good solution. I think the behavior as now is ok, and at this time I see now way to improve it. __

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-18 Thread Skip Montanaro
Skip Montanaro <[EMAIL PROTECTED]> added the comment: What do you think the delimiter should be for this csv file? 43.4e12 147483648 47483648 What about this one? abcdef bcdefg cdefgh And this? abc8def bcd8efg cde8fgh If I force the sniffer to not allow digits or letters as delimiters I can

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-17 Thread Wolfgang Langner
Wolfgang Langner <[EMAIL PROTECTED]> added the comment: The sniffer returns an dialect that is not really correct. Because the delimiter is set to value and in this case there is no delimiter. See it as, it returns a random delimiter if there is not really one. But your usage of the DictReader i

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-02-12 Thread Jean-Philippe Laverdure
Changes by Jean-Philippe Laverdure: -- components: +Library (Lib) -Extension Modules versions: +Python 2.4 __ Tracker <[EMAIL PROTECTED]> __ ___

[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-02-12 Thread Jean-Philippe Laverdure
New submission from Jean-Philippe Laverdure: When attempting to sniff() the dialect for the attached .csv file, csv.Sniffer.sniff() returns an unusable dialect: >>> import csv >>> file = open('listB2Mforblast.csv', 'r') >>> dialect = csv.Sniffer().sniff(file.readline()) >>> file.seek(0) >>> file