Skip to content
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

Enhance missing VCS command detection (errno 13) #75

Merged
merged 3 commits into from Aug 25, 2019

Conversation

lowell80
Copy link
Contributor

On some Linux platforms (possibly due to an LSM such as SELinux or AppArmor) instead of just getting error 2 (File not found) the OS returns error 13 (Permission Denied). This patch treats errorno 2 and 13 the same. Simply put, the VCS is not available and therefore should not be considered.

Without this fix, on some Linux machines, running bumpversion or bumpversion --help results in:

OSError: [Error 13] Permission denied

@lowell80
Copy link
Contributor Author

This addresses the bug originally found and documented in the upstream repo:
peritus/bumpversion#160

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Makes sense. While you're there, mind improving it slightly more?

bumpversion/vcs.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Fixed a trivial nitpick, otherwise 👍

lowell80 and others added 3 commits August 24, 2019 16:59
If a given VCS command is not executable or blocked from execution by a LSM
(SELinux/AppArmor) for example, then consider that VCS to be unavailable.
This change prevents the error:  OSError: [Error 13] Permission denied
- Swap hard-coded error numbers with constants from the errno module.
@c4urself c4urself merged commit a0fb7b3 into c4urself:master Aug 25, 2019
@florisla florisla added this to the v1.0.0 milestone Jan 25, 2021
@florisla florisla added the bug label Jan 25, 2021
@lowell80 lowell80 deleted the fix-vcs-handle-errno13 branch April 1, 2021 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants