[Python-checkins] r45925 - in python/trunk: Lib/tempfile.py Lib/test/test_os.py Misc/NEWS Modules/posixmodule.c

M.-A. Lemburg mal at egenix.com
Sat May 6 19:42:48 CEST 2006


martin.v.loewis wrote:
> Author: martin.v.loewis
> Date: Sat May  6 18:32:54 2006
> New Revision: 45925
> 
> Modified:
>    python/trunk/Lib/tempfile.py
>    python/trunk/Lib/test/test_os.py
>    python/trunk/Misc/NEWS
>    python/trunk/Modules/posixmodule.c
> Log:
> Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.
> 
> Modified: python/trunk/Lib/tempfile.py
> ==============================================================================
> --- python/trunk/Lib/tempfile.py	(original)
> +++ python/trunk/Lib/tempfile.py	Sat May  6 18:32:54 2006
> @@ -327,6 +327,10 @@
>          try:
>              _os.mkdir(file, 0700)
>              return file
> +        except WindowsError, e:
> +            if e.errno == 183: # ERROR_ALREADY_EXISTS
> +                continue # try again
> +            raise
>          except OSError, e:
>              if e.errno == _errno.EEXIST:
>                  continue # try again

Rather than adding new cases for the changed error codes,
wouldn't it be better and more backwards compatible to
add aliases to the errno module for e.g. ERROR_ALREADY_EXISTS ?!

The errno module currently only has this entry:

#ifdef EEXIST
	inscode(d, ds, de, "EEXIST", EEXIST, "File exists");
#endif

Regards,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, May 06 2006)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-checkins mailing list