Skip to content

Conversation

@ikus060
Copy link
Contributor

@ikus060 ikus060 commented Jun 26, 2025

Changes done and why

Change error handling arround acl_win.py to catch NotImplementedError that get raised by acl.GetAce() when the ACL type is not supported.

This issue was repported by a Minarca User.
https://gitlab.com/ikus-soft/minarca/-/issues/324

Self-Checklist

  • [-] changes to the code have been reflected in the documentation
  • [-] changes to the code have been covered by new/modified tests
  • [-] commit contains a description of changes relevant to users prefixed by DOC:, FIX:, NEW: and/or CHG:

@ikus060
Copy link
Contributor Author

ikus060 commented Jun 26, 2025

@ericzolf If you could tkae a look at this one.

I did not write unit test as I dont see any specific test for acl_win...

@ericzolf ericzolf marked this pull request as draft June 27, 2025 06:02
@ericzolf ericzolf changed the title WIP: Handle NotImplementedError raised by acl_win Handle NotImplementedError raised by acl_win Jun 27, 2025
@ericzolf
Copy link
Member

I made this PR a draft and removed the WIP prefix, you old GitLab afficionado! 😏

More seriously:

  1. I need a fresh mind to understand this one, few words of explanation might help
  2. Good occasion to add acl_win tests! In a separate file so they can be included in tox_win only.

@ikus060
Copy link
Contributor Author

ikus060 commented Jun 27, 2025

@ericzolf The git diff looks a bit weird, but honestly, I didn't change much.

I just moved most of the code interacting with the DACL into a try...except block and added a new exception type to catch: NotImplementedError.

This is all to handle an exception raised by acl.GetAce() when it encounters an unsupported ACE type:
https://github.com/mhammond/pywin32/blob/0c7297b861b962a00e0a14a6d995f339663429e0/win32/src/PyACL.cpp#L148

@ericzolf
Copy link
Member

My comment was definitely more about my foggy brain that about your change.

@ericzolf ericzolf force-pushed the patrik-fix-acl-win-not-implemented-error branch from 749d06b to e1c3078 Compare June 29, 2025 06:51
Copy link
Member

@ericzolf ericzolf left a comment

Choose a reason for hiding this comment

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

I allowed myself to rebase your branch to make the comparison easier locally.
The code itself looks all good to me. Two little things:

  1. change the commit message to add a FIX explaining the change
  2. would you mind creating a new test file for win_acl and adding a test (or two)?

@ikus060 ikus060 closed this Jul 9, 2025
@ikus060 ikus060 deleted the patrik-fix-acl-win-not-implemented-error branch July 9, 2025 17:25
@ericzolf
Copy link
Member

Out of curiosity, why did you close this PR?

@ikus060 ikus060 restored the patrik-fix-acl-win-not-implemented-error branch July 11, 2025 11:20
@ikus060 ikus060 reopened this Jul 11, 2025
@ikus060
Copy link
Contributor Author

ikus060 commented Jul 11, 2025

I might have delete the branch my mistake.

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