This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients christian.heimes, ronaldoussoren, saurabhgupta2u
Date 2013-07-22.08:21:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1374481268.52.0.881086888241.issue18525@psf.upfronthosting.co.za>
In-reply-to
Content
WindowsError is not part of the documented interface of shutil, but is an implementation detail.

"from shutil import WindowsUtil" works on Unix platforms because shutil contains a compatibility definition:

try:
    WindowsError
except NameError:
    WindowsError = None

shutil.copytree uses this to ignore some errors on Windows (that is, uses "if WindowsError is not None and isinstance(exc, WindowsError): ...").

Note that in 3.4 shutil does not export WindowsError at all, it uses a different way to suppress errors in copytree.

In a perfect world the code would have used:

try:
    _WindowsError = WindowsError
except NameError:
    _WindowsError = None

This would have avoided accidently exporting WindowsError on Unix platforms. I don't think it is worthwhile to do this change in a bugfix release though.
History
Date User Action Args
2013-07-22 08:21:08ronaldoussorensetrecipients: + ronaldoussoren, christian.heimes, saurabhgupta2u
2013-07-22 08:21:08ronaldoussorensetmessageid: <1374481268.52.0.881086888241.issue18525@psf.upfronthosting.co.za>
2013-07-22 08:21:08ronaldoussorenlinkissue18525 messages
2013-07-22 08:21:08ronaldoussorencreate