A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-September/091924.html below:

[Python-Dev] POSIX [Fuzziness in io module specs]

[Python-Dev] POSIX [Fuzziness in io module specs] [Python-Dev] POSIX [Fuzziness in io module specs]Greg Ewing greg.ewing at canterbury.ac.nz
Sun Sep 20 02:23:20 CEST 2009
Nick Coghlan wrote:

> For example, a file not existing, a file being locked by another
> process, and the user not having write permissions to the file are
> problems that demand very different responses from the user.

You can display an error-specific message without having
to inspect the error code, e.g.

   try:
     something_with_file(path)
   except EnvironmentError, e:
     report_error("Couldn't do that with %s: %s" % (path, e))

This is a pattern I use a lot, and it seems to work
pretty well.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4