windows: provide filename in IOError exceptions

This brings the Windows posixfile errors in line with the errors
on other platforms.
This commit is contained in:
Steve Borho 2009-09-14 19:53:43 -05:00
parent 54f5a65629
commit 68d79882b6

View File

@ -17,7 +17,7 @@ def posixfile(name, mode='r', buffering=-1):
try:
return osutil.posixfile(name, mode, buffering)
except WindowsError, err:
raise IOError(err.errno, err.strerror)
raise IOError(err.errno, '%s: %s' % (name, err.strerror))
posixfile.__doc__ = osutil.posixfile.__doc__
class winstdout(object):