Skip to content

Conversation

@sanathkr
Copy link
Contributor

@sanathkr sanathkr commented May 31, 2019

WindowsError is a subclass of OSError. It is defined and raised only
in Windows. Hence the exception statement will return a
WindowsError keyword is undefined in other platforms.

EDIT: Usually this error is encountered when CodeUri: /folder/does/not/exist. The builder tries to copy the files and fails because the path does not exist. On Windows, the exception handler works, but on Mac/Linux Python interpreter does not find the variable WindowsError and crashes. So it leads to a vague WindowsError on Mac/Linux.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

WindowsError is a subclass of `OSError`. It is defined and raised only
in Windows. Hence the exception statement will return a
`WindowsError keyword is undefined` in other platforms.
# Let's try to copy the directory metadata from source to destination
shutil.copystat(source, destination)
except WindowsError as ex: # pylint: disable=undefined-variable
except OSError as ex: # pylint: disable=undefined-variable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the pytlint disable here?

@sriram-mv
Copy link
Contributor

Can you add context on where you encountered this? will help for why this was fixed.

@sanathkr
Copy link
Contributor Author

sanathkr commented Jun 6, 2019

  • Removed pylint ignore
  • Updated Description with more context on the error.

@sanathkr sanathkr merged commit df3b9d8 into aws:develop Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants