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/2006-January/060244.html below:

[Python-Dev] "DOS" error codes, WindowsError, and errno

[Python-Dev] "DOS" error codes, WindowsError, and errnoGuido van Rossum guido at python.org
Tue Jan 31 02:09:20 CET 2006
What a mess. :-(

WindowsError should have used a different name for the Windows-native
error code, so we could have defined both separately without
confusion.

Is it too late to change WindowsError in that way?

Unhelpfully,

--Guido

On 1/30/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> I have a new implementation of stat/fstat/wstat which directly uses
> Win32 API, rather than using msvcrt. This works fine so far, except
> that error handling turns out to be tricky.
>
> mscvcrt maps errors (GetLastError()) into errno.h values, and also
> preserves the original error code in _doserrno. Currently, stat()
> will raise OSError, with errno set to the errno.h value.
>
> Because the Win32 error codes are much more fine-grained, this
> conversion loses information. Python raises WindowsError in
> some cases (e.g. os.listdir); WindowsError inherits from OSError,
> but the errno attribute now must be interpreted as a Win32 error.
> This is unfortunate, because the values overlap, and somebody
> handling OSError might confuse the error codes for errno.h
> (msvcrt) values.
>
> So what should I do in the new stat implementation? Try to map
> error codes also? Raise WindowsErrors instead? Do something else
> entirely?
>
> Comments appreciated.
>
> Regards,
> Martin
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
>


--
--Guido van Rossum (home page: http://www.python.org/~guido/)
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