PyDocs

Nav

Python Runtime Services

OSError

builtins

exception
  • OSError([arg])
  • OSError(errno, strerror[, filename[, winerror[, filename2]]])
Base class for I/O related errors.
Changed in 3.3, 3.4
  • 3.3: EnvironmentError, IOError, WindowsError, socket.error, select.error and mmap.error have been merged into OSError, and the constructor may return a subclass.
  • 3.4: The filename attribute is now the original file name passed to the function, instead of the name encoded to or decoded from the filesystem encoding and error handler. Also, the filename2 constructor argument and attribute was added.
Members of OSError

e

errno
POSIX exception code

f

filename
exception filename
filename2
second exception filename

s

strerror
exception strerror

w

winerror
Under Windows, this gives you the native Windows error code.
0 Examples
No examples for builtins/OSError.
See Also
No see-alsos for builtins/OSError
0 Notes
No notes for OSError