Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:error': 0.03; 'true,': 0.05; 'subject:files': 0.09; 'cc:addr:python-list': 0.11; 'detected': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sockets': 0.16; 'subject:handling': 0.16; 'subject:when': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'ssl': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'actual': 0.34; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'even': 0.60; "you're": 0.61; 'happen': 0.63; 'jul': 0.74; '7:00': 0.84; 'of?': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=PYK3kJiL1d4IeNbFGRThXzMEJQOnYZovC7fT3DoomX0=; b=oJkjCAMRQ9cG3lo5plfWZz0FH6Xh0QDFJz9xGXXwr7ww6N5KIpDc14IfK4ucaQHnUj CguH+wiXluQhn+WseOtLOmSxqhGAymFox2lUPGM2fbQ2a2J5QUt0zGFW3Fcw/0sskB0n UwN2BAdH3lCuq4L44Asbs4MjXvsIC2qMXD11vtJU5Wlt7TzQGDyfsYb+RkPJwPZT4Nu9 SCmkw4TjgPBlPcve+zgMy+P5a+welpyV1CCZyPWLMEDiqfyFSxJzR/T3csO7mYfYsKaB yJyeDMM2Xixw1oTnm9CWMKU90C84j6PR3Nbja9HIa+YNDE4PnzwnIIAI/W2+jRhmFUYj xKgg== MIME-Version: 1.0 X-Received: by 10.58.65.104 with SMTP id w8mr11870957ves.19.1404815753532; Tue, 08 Jul 2014 03:35:53 -0700 (PDT) In-Reply-To: <53bbb33b$0$2926$c3e8da3$76491128@news.astraweb.com> References: <53bbb33b$0$2926$c3e8da3$76491128@news.astraweb.com> Date: Tue, 8 Jul 2014 20:35:53 +1000 Subject: Re: error handling when opening files From: Chris Angelico Cc: "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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404815761 news.xs4all.nl 2919 [2001:888:2000:d::a6]:58050 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74162 On Tue, Jul 8, 2014 at 7:00 PM, Steven D'Aprano wrote: > Interestingly, did you know that even *closing* a file can fail? I know that can happen with SSL sockets (which can require writing and reading). Can't think of any situations on normal file systems where that's true, unless the actual failure is in the flushing of buffers; technically, that's not a failure of closing, but it could be a failure that's detected on close(). Is that what you're thinking of? ChrisA