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


Groups > comp.lang.python > #46177 > unrolled thread

Re: Python error codes and messages location

Started byChris Angelico <rosuav@gmail.com>
First post2013-05-27 17:47 +1000
Last post2013-05-27 17:47 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python error codes and messages location Chris Angelico <rosuav@gmail.com> - 2013-05-27 17:47 +1000

#46177 — Re: Python error codes and messages location

FromChris Angelico <rosuav@gmail.com>
Date2013-05-27 17:47 +1000
SubjectRe: Python error codes and messages location
Message-ID<mailman.2240.1369640875.3114.python-list@python.org>
On Mon, May 27, 2013 at 4:11 PM, Cameron Simpson <cs@zip.com.au> wrote:
> On 27May2013 04:49, Carlos Nepomuceno <carlosnepomuceno@outlook.com> wrote:
> | That's bad! I'd like to check all the IOError codes that may be
> | raised by a function/method but the information isn't there.
>
> No, you really don't.

Heh. I concur. Opening a file can generate roughly forty-two million
different errors. Here's a smattering that you might not be expecting:

* The path points somewhere that's not currently mounted
* The path represents a device that is not properly working
* It's over a network and the server at the far end is down
* It's over a network and the server sends back maliciously crafted data
* It's over a network and the server sends back an incorrect error code
* You tried to open something that doesn't exist, and your disk quota is used up
* The system has run out of handles
* You're trying to create something in the root directory of a FAT
volume that already has too many root directory entries

And plenty more besides. Those are just a few that I could come up
with off the top of my head.

Just catch whatever makes sense (IOError maybe), and don't sweat the details.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web