Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!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.040 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'subject:Python': 0.06; 'error:': 0.07; 'subject:File': 0.16; 'traceback.': 0.16; 'typeerror:': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'trying': 0.19; 'error': 0.23; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'getting': 0.31; 'posting': 0.31; 'file:': 0.31; 'file': 0.32; 'text': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'useful': 0.36; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'removing': 0.60; 'full': 0.61; "you're": 0.61; 'love': 0.65; 'invalid': 0.68 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=CozsU2jdAxFVtqCpUO49MTBo+G/fSKIGMfCbyr28/a4=; b=dPOETPd+/Ua6bs/BaWUdFSWGZT7IkEyRf2TpL+Gm7sIxdjNh4kHb8NMF/9dSonF9Vm uhqamS0QDsf2tmZbFtooazVX5UUQnn/5Qa/McRcwgz7RTv4XiIAac0DgtJzuVRbx5MbU gIjPgJF89R9JfjLFRNc0pbpdmUQeW+OHqwIMBf8II5m22pBA8+dMTgkeUJCfknFFhliV OAuJ07Z3tpCLlYNdPVejwge7cHNnw9NVy8ZskCs9dg3L6NVvwwaxen/EXPiFvNrzlFtX 9La5e86Zv02+BAXGl7dz2vU1xYq47MJaYqcwB9NsaXILxGVJVnihF7llt+xXSBkH5N23 F0JA== X-Received: by 10.236.45.10 with SMTP id o10mr1771230yhb.49.1403133558192; Wed, 18 Jun 2014 16:19:18 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <8aaa4195-af5c-4ba3-a891-b1f268c086ac@googlegroups.com> References: <8aaa4195-af5c-4ba3-a891-b1f268c086ac@googlegroups.com> From: Ian Kelly Date: Wed, 18 Jun 2014 17:18:38 -0600 Subject: Re: Python Fails to Write to File To: Python Content-Type: text/plain; charset=UTF-8 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1403133566 news.xs4all.nl 2846 [2001:888:2000:d::a6]:39399 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73385 On Wed, Jun 18, 2014 at 5:03 PM, cutey Love wrote: > I'm trying to write data to a text file > > But I'm getting the error: > > TypeError: invalid file: <_io.TextIOWrapper Post the full traceback. By posting only the error message you're removing useful information.