Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.04; 'binary': 0.05; 'omit': 0.07; 'python': 0.09; 'open()': 0.09; 'specifying': 0.09; '"b"': 0.16; '"r",': 0.16; "'b'": 0.16; 'shot.': 0.16; 'unicode.': 0.16; 'wrote:': 0.17; 'converted': 0.22; 'originally': 0.23; 'raise': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'handling': 0.27; 'important.': 0.27; 'environment': 0.29; 'mode': 0.30; 'file': 0.32; 'to:addr:python- list': 0.33; 'text': 0.34; 'pm,': 0.35; 'similar': 0.35; "didn't": 0.36; 'problems': 0.36; 'subject:: ': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'end': 0.40; 'john': 0.60; 'received:74.208': 0.71; 'yours.': 0.93 Date: Thu, 07 Mar 2013 19:23:20 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Unhelpful traceback References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:MMhkoDcr/dEB0MEEURkP9fZKRLUmuGn1dGnrRLd1JuO 8Kt1n16tyBquDjldhz9J738/Q3bfTaISp80+g7AB/E/6kPIxMu 41+8ietDiuMFRgCzxS6/GvQLkdcvwf7pIXurhUpL5YDKViEHKv I9rCNfkrGeS0pzacTOg2V7ZeyAzuPEyMDrl7Bf82bRGybq7IbB lgLsC3bHVvl24jGL6/15/iha2PrYgyFZFmghwye5bFkOnD5lSz vb6EyFwYtlSlCUeAyXjehsFpLIReD+482nQIugXtO1ZrVQgRio shvvKchVL8eSezseu4ygyFFJ9YIiaEPf9J1gNtYqvuMa3P9xA= = 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: 1362702220 news.xs4all.nl 6879 [2001:888:2000:d::a6]:36128 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40837 On 03/07/2013 04:23 PM, John Nagle wrote: > >> > > raise RuntimeError, 'open() requires mode "r", "U", or "rU"' > RuntimeError: open() requires mode "r", "U", or "rU" > > "b" for files is about end of line handling (CR LF -> LF), anyway. > Only for Python 2. Since originally you didn't specify, I took my best shot. If you omit the 'b' opening a binary file in Python 3, you'd get problems similar to yours. Text files will be converted to Unicode. That's one of the reasons that specifying the full environment is important. -- DaveA