Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30060

Re: python file API

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
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; 'subsequent': 0.04; 'raised': 0.07; 'subject:file': 0.07; 'try:': 0.07; 'python': 0.09; 'corresponds': 0.09; 'e.errno': 0.09; 'ioerror:': 0.09; 'lawrence': 0.09; 'oserror': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sep': 0.09; 'url:peps': 0.09; 'thread': 0.11; 'subject:python': 0.11; '2.7': 0.13; '"syntax': 0.16; '24,': 0.16; 'adam': 0.16; 'benjamin': 0.16; 'errno.h': 0.16; 'hierarchy.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:w 70': 0.16; 'subject:API': 0.16; 'url:whatsnew': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'url:dev': 0.17; '>>>': 0.18; 'raise': 0.24; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '(most': 0.27; 'guess': 0.27; "doesn't": 0.28; 'header:X -Complaints-To:1': 0.28; 'lines': 0.28; '>>>>': 0.29; 'error': 0.30; 'url:python': 0.32; 'file': 0.32; 'from:addr:yahoo.co.uk': 0.32; 'anywhere': 0.33; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'along': 0.35; 'pm,': 0.35; 'continue': 0.35; 'something': 0.35; 'next': 0.35; 'received:org': 0.36; 'except': 0.36; 'url:org': 0.36; 'subject:: ': 0.38; 'mark': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'referred': 0.62; 'oscar': 0.84; 'ideas.': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: python file API
Date Tue, 25 Sep 2012 11:51:56 +0100
References <0ec1fe2e-890c-4e25-8047-4cb8bee0aa95@googlegroups.com> <5060D55C.3000407@davea.name> <mailman.1222.1348524844.27098.python-list@python.org> <a8dc1fb1-b5ff-46fe-8486-91fdc2ad91de@googlegroups.com> <CAHVvXxQa08bFVJ10x75jeRYxDw4J3xPyvRauqP5haq=ppV6DKQ@mail.gmail.com> <CAMjeLr_bjbG3GA5RWux5nuz9LNeX93Eh7RLvg5i9mBsdWU8YOw@mail.gmail.com> <k3rmbv$lb9$1@ger.gmane.org> <CAHVvXxSpfsfHB14ztOD-D6_GVBUWGegjXs6Ai6vUJ1yCf7_1QA@mail.gmail.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-78-147-20-3.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.0; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
In-Reply-To <CAHVvXxSpfsfHB14ztOD-D6_GVBUWGegjXs6Ai6vUJ1yCf7_1QA@mail.gmail.com>
X-Antivirus avast! (VPS 120924-1, 24/09/2012), Outbound message
X-Antivirus-Status Clean
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1312.1348570223.27098.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348570223 news.xs4all.nl 6841 [2001:888:2000:d::a6]:38139
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:30060

Show key headers only | View raw


On 25/09/2012 11:38, Oscar Benjamin wrote:
> On 25 September 2012 08:27, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
>
>> On 25/09/2012 03:32, Mark Adam wrote:
>>
>>> On Mon, Sep 24, 2012 at 5:55 PM, Oscar Benjamin
>>> <oscar.j.benjamin@gmail.com> wrote:
>>>
>>>> try:
>>>>       f.pos = 256
>>>> except IOError:
>>>>       print('Unseekable file')
>>>
>>>
>> Something along these lines http://docs.python.org/dev/**
>> whatsnew/3.3.html#pep-3151-**reworking-the-os-and-io-**exception-hierarchy<http://docs.python.org/dev/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy>?
>
>
> I just tried to find out what error would be raised by seeking on a file
> that doesn't support seeking and II think it's just OSError in the reworked
> hierarchy. The error in Python 2.7 is
>
> Traceback (most recent call last):
>    File "tmp.py", line 2, in <module>
>      sys.stdin.seek(5)
> IOError: [Errno 29] Illegal seek
>
> This corresponds to ESPIPE from errno.h which isn't referred to anywhere in
> pip 3151:
> http://www.python.org/dev/peps/pep-3151/
>
> So I guess it would still need to be
>
> try:
>      f.pos = 256
> except OSError as e:
>      if e.errno != 29:
>          raise
>      print('Unseekable file')
>
> Oscar
>
>
>

The thing I was thinking of is actually in the thread "syntax to 
continue into the next subsequent except block" over on Python ideas.

-- 
Cheers.

Mark Lawrence.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python file API zipher <dreamingforward@gmail.com> - 2012-09-24 14:35 -0700
  Re: python file API Dave Angel <d@davea.name> - 2012-09-24 17:49 -0400
    Re: python file API Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-09-25 08:22 +0200
      Re: python file API Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-25 04:19 -0400
        Re: python file API Grant Edwards <invalid@invalid.invalid> - 2012-09-25 14:07 +0000
      Re: python file API Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-25 12:07 -0400
      Re: python file API Chris Angelico <rosuav@gmail.com> - 2012-09-26 02:12 +1000
  Re: python file API Chris Kaynor <ckaynor@zindagigames.com> - 2012-09-24 14:58 -0700
  Re: python file API Chris Angelico <rosuav@gmail.com> - 2012-09-25 08:14 +1000
    Re: python file API zipher <dreamingforward@gmail.com> - 2012-09-24 15:36 -0700
      Re: python file API Mark Adam <dreamingforward@gmail.com> - 2012-09-24 21:32 -0500
      Re: python file API Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-25 08:27 +0100
      Re: python file API Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-25 11:51 +0100
    Re: python file API zipher <dreamingforward@gmail.com> - 2012-09-24 15:36 -0700
      Re: python file API Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-25 02:28 +0000
        Re: python file API Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-09-25 07:25 +0200
          Re: python file API Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-25 07:28 +0000
            Re: python file API Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-09-25 21:40 +0200
    Re: python file API Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-25 01:33 +0000
  Re: python file API Dave Angel <d@davea.name> - 2012-09-24 18:36 -0400
  Re: python file API Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-24 16:37 -0600
    Re: python file API Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-09-25 07:32 +0200
      Re: python file API Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-25 04:13 -0400
        Re: python file API Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-09-25 11:53 +0200
      Re: python file API Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-25 03:32 -0600
  Re: python file API Chris Angelico <rosuav@gmail.com> - 2012-09-25 08:57 +1000
  Re: python file API Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-25 00:12 +0100
  Re: python file API Chris Kaynor <ckaynor@zindagigames.com> - 2012-09-24 16:14 -0700
  Re: python file API Ramchandra Apte <maniandram01@gmail.com> - 2012-09-30 05:50 -0700

csiph-web