Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'subject:text': 0.05; 'binary': 0.07; 'subject:file': 0.07; 'lawrence': 0.09; 'newline': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:into': 0.09; 'python': 0.11; 'language.': 0.14; 'csv': 0.16; 'expects': 0.16; 'mode,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'language': 0.16; 'wrote:': 0.18; 'module': 0.19; 'version.': 0.19; 'this?': 0.23; 'header:User-Agent:1': 0.23; "i've": 0.25; 'handling': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'mode': 0.30; 'file': 0.32; 'open': 0.33; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'our': 0.64; '2.7.': 0.84; 'received:89': 0.85 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: parse a csv file into a text file Date: Thu, 06 Feb 2014 17:40:19 +0000 References: <5c268845-003f-4e24-b27a-c89e9fbfcc6c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-89-240-160-253.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391708444 news.xs4all.nl 2872 [2001:888:2000:d::a6]:41226 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65544 On 06/02/2014 14:02, Neil Cerutti wrote: > > You must open the file in binary mode, as that is what the csv > module expects in Python 2.7. newline handling can be enscrewed > if you forget. > > file = open('raw.csv', 'b') > I've never opened a file in binary mode to read with the csv module using any Python version. Where does it state that you must do this? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence