Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!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.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'python': 0.09; 'tempfile': 0.09; 'typeerror:': 0.09; 'subject:not': 0.11; 'writer': 0.16; '>>>': 0.18; 'feb': 0.19; 'import': 0.21; '"",': 0.22; '(most': 0.27; 'subject:skip:d 10': 0.27; 'message-id:@mail.gmail.com': 0.27; 'interface': 0.27; 'lines': 0.28; 'maybe': 0.29; "skip:' 10": 0.30; 'file': 0.32; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'or,': 0.34; 'along': 0.35; 'does': 0.37; 'to:addr:python.org': 0.39; 'skip:n 10': 0.63; 'more': 0.63; 'skip:n 30': 0.69; 'goal': 0.74; 'subject:skip:N 10': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=OQaW8Moi2FHUJK+KPwD39GXZ9cYnxqFsYWiFPeu0A7g=; b=UmGYFdqOAeOZQQmYSDHcTUlew4u5caodvazqmt2DKyRqe74ElWa1FHTWw9JnWrKiEK ObLCuES55wi/nbk0ghq68XnAq0B0J/WyixtnRK/oQuNMCsp5isPqBAlBqKfMmkT732sQ 2CNymg91zABYt9NLJ52+9LcREq45VdYl08Q7lX8yl6hO+2K++TyzoXbZHhx5N4HcdZqj bCEIsgIppvlf8a1gELj1LcsALD+2/SmiIKH8S8L8Q0RqcV0oFpeZRoJFWvIVi+R2YCm1 CHMtfAZaEFEPgx81nRfeLoBOt5ynOHVyALMt5LSjmQkxOERPPSgRUKfFPNgdb1wKDv4V 6XGw== MIME-Version: 1.0 X-Received: by 10.50.195.134 with SMTP id ie6mr12658472igc.6.1361479603280; Thu, 21 Feb 2013 12:46:43 -0800 (PST) Date: Thu, 21 Feb 2013 12:46:43 -0800 Subject: NamedTemporaryFile does not match documentation From: Jason Friedman To: python-list@python.org 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361479605 news.xs4all.nl 6960 [2001:888:2000:d::a6]:47605 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39456 Python 3.2.2 (default, Feb 14 2012, 08:06:31) [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from tempfile import NamedTemporaryFile >>> f = NamedTemporaryFile(delete=False) >>> f >>> f.name '/tmp/tmpqxnd_4' >>> f.write("Hello World!\n") Traceback (most recent call last): File "", line 1, in TypeError: 'str' does not support the buffer interface Or, maybe I am reading the documentation incorrectly. My goal is to be able to write to that temporary file along the lines of "f.write()" or "with open(f) as writer ...".