diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 62a3fdc..6465b11 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.2.1 +current_version = 0.2.2 commit = False tag = False tag_name = {new_version} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2666e49..c95b65e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ ## Changelog -### 0.2.1 +### 0.2.2 -**Commit Delta**: [Change from 0.2.0 release](https://github.com/YakDriver/oschmod/compare/0.2.0...0.2.1) +**Commit Delta**: [Change from 0.2.0 release](https://github.com/YakDriver/oschmod/compare/0.2.0...0.2.2) -**Released**: 2020.04.20 +**Released**: 2020.04.21 **Summary**: diff --git a/oschmod/__init__.py b/oschmod/__init__.py index bd5fe8a..d46ca66 100644 --- a/oschmod/__init__.py +++ b/oschmod/__init__.py @@ -36,6 +36,7 @@ try: import ntsecuritycon # noqa: F401 import win32security # noqa: F401 + from pywintypes import error as pywinerror HAS_PYWIN32 = True except ImportError: pass @@ -152,7 +153,7 @@ "S_IXOTH" ) -__version__ = "0.2.1" +__version__ = "0.2.2" def get_mode(path): @@ -349,9 +350,12 @@ def _win_set_permissions(path, mode, object_type): system_ace = None for _ in range(0, dacl.GetAceCount()): ace = dacl.GetAce(0) - if ace[2] and ace[2].IsValid() and win32security.LookupAccountSid( - None, ace[2]) == SECURITY_NT_AUTHORITY: - system_ace = ace + try: + if ace[2] and ace[2].IsValid() and win32security.LookupAccountSid( + None, ace[2]) == SECURITY_NT_AUTHORITY: + system_ace = ace + except pywinerror: + print("Found orphaned SID:", ace[2]) dacl.DeleteAce(0) if system_ace: diff --git a/setup.cfg b/setup.cfg index 9f0237c..4ff2b31 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ name = oschmod description = Windows and Linux compatible chmod long_description = file: README.md, CHANGELOG.md long_description_content_type = text/markdown -version = 0.2.1 +version = 0.2.2 author = YakDriver author_email = projects@plus3it.com url = https://github.com/yakdriver/oschmod