Skip to content

[2.7] bpo-30265: support.unlink() don't catch any OSError #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2017
Merged

[2.7] bpo-30265: support.unlink() don't catch any OSError #1456

merged 1 commit into from
May 5, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 4, 2017

support.unlink() now only ignores ENOENT and ENOTDIR, instead of
ignoring any OSError exception.

@vstinner
Copy link
Member Author

vstinner commented May 4, 2017

test_sax fails with this change on Windows. I would prefer to first fix http://bugs.python.org/issue30264

@vstinner vstinner changed the title bpo-30265: support.unlink() don't catch any OSError [2.7] bpo-30265: support.unlink() don't catch any OSError May 4, 2017
except OSError:
pass
except OSError as exc:
if exc.errno in (errno.ENOENT, errno.ENOTDIR):
Copy link
Member

Choose a reason for hiding this comment

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

Maybe invert the condition?

if exc.errno not in (errno.ENOENT, errno.ENOTDIR):
    raise

Copy link
Member Author

Choose a reason for hiding this comment

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

done

support.unlink() now only ignores ENOENT and ENOTDIR, instead of
ignoring any OSError exception.
@vstinner
Copy link
Member Author

vstinner commented May 4, 2017

@serhiy-storchaka: This PR is now blocked by http://bugs.python.org/issue30264 (xml.sax bug). Would you mind to review my PR #1451 please?

@vstinner vstinner merged commit 03b2788 into python:2.7 May 5, 2017
@vstinner vstinner deleted the support_unlink_27 branch May 5, 2017 08:27
@vstinner
Copy link
Member Author

vstinner commented May 5, 2017

I fixed http://bugs.python.org/issue30264 so I was able to merged this change as well.

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