From moe.ndiaye at mirant.com Thu Sep 29 22:06:09 2005 From: moe.ndiaye at mirant.com (Ndiaye, Moe) Date: Thu, 29 Sep 2005 16:06:09 -0400 Subject: [Csv] PEP 305 Message-ID: <8EE4B60D3CFA10489B9CBA0D8BA64264021CC9ED@ATLEXMS01.na.mirant.net> When I try to open a csv file from a website, the option to "open this file from its currebt location" is grayed out forcing me to download it to my hard drive in order to view it. Please help. Thanks. moe ndiaye mirant corp. From paul1brian at gmail.com Fri Sep 30 10:53:00 2005 From: paul1brian at gmail.com (paul brian) Date: Fri, 30 Sep 2005 09:53:00 +0100 Subject: [Csv] Request for enhancement for csv Message-ID: Dear csv maintainer, I am uncertain if this is the correct place for a RFE, please point me to an appropriate place if not. I felt it would be safer to annoy one person rather than an entire python-dev mailing list. Apologies if I have succeeded in annoying you of course :-) I have not had a look at the csv repository but if you could confirm this is not a terrible idea or already done please also give me any pointers you might think of - its an itch and I think I shall have to scratch it in the next week or two. thank you Test for correct header row ==================== When opening a csv file using DictReader, I would like to be able to test that the file contains the correct header files as I expected. This would prevent me from opening the incorrect file and seeing a indexError. I suspect the best approach would be to add a *strict* option to the constructor's parameters as follows class DictReader( csvfile[, fieldnames=None[,Strict,[, restkey=None[, restval=None[, dialect='excel' [, *args, **kwds]]]]]]) if strict exists and is True then fieldnames must also exist and the csv module would inspect the first line and raise a "headerViolation" error if fielnames does not match the first row when first row is converted to a list. -- -------------------------- Paul Brian m. 07875 074 534 t. 0208 352 1741 From paul1brian at gmail.com Fri Sep 30 10:56:08 2005 From: paul1brian at gmail.com (paul brian) Date: Fri, 30 Sep 2005 09:56:08 +0100 Subject: [Csv] Re: Request for enhancement for csv In-Reply-To: References: Message-ID: My apologies for the last post - I could only find bug reports on sourceforge until 2 minutes after posting to you. Again my apologies On 9/30/05, paul brian wrote: > Dear csv maintainer, > > I am uncertain if this is the correct place for a RFE, please point me > to an appropriate place if not. I felt it would be safer to annoy one > person rather than an entire python-dev mailing list. > > Apologies if I have succeeded in annoying you of course :-) > > I have not had a look at the csv repository but if you could confirm > this is not a terrible idea or already done please also give me any > pointers you might think of - its an itch and I think I shall have to > scratch it in the next week or two. > > thank you > > > Test for correct header row > ==================== > > When opening a csv file using DictReader, I would like to be able to > test that the file contains the correct header files as I expected. > This would prevent me from opening the incorrect file and seeing a > indexError. > > I suspect the best approach would be to add a *strict* option to the > constructor's parameters as follows > > class DictReader( csvfile[, fieldnames=None[,Strict,[, restkey=None[, > restval=None[, dialect='excel' [, *args, **kwds]]]]]]) > > if strict exists and is True then fieldnames must also exist and the > csv module would inspect the first line and raise a "headerViolation" > error if fielnames does not match the first row when first row is > converted to a list. > > > > -- > -------------------------- > Paul Brian > m. 07875 074 534 > t. 0208 352 1741 > -- -------------------------- Paul Brian m. 07875 074 534 t. 0208 352 1741