[issue18525] Shutil cannot import WindowsError on windows

Christian Heimes report at bugs.python.org
Mon Jul 22 09:52:26 CEST 2013


Christian Heimes added the comment:

Seems legit ... I don't have access to a Windows system right now so I can't test it.

WindowsError is globally available on Windows. You don't have to import it from shutil. Portable application should use OSError instead of WindowsError. WindowsError is a subclass of OSError with a Windows specific extra field. "try: ... except OSError: ..." catches WindowsError, too.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18525>
_______________________________________


More information about the Python-bugs-list mailing list