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
Python 3.11 compatibility because of enum module #108
Comments
Thank you for reporting. I will try to support 3.11 in a future release. I'll keep the issue open until then |
I did some looking into this, turns out that IntFlag enums are now iterable, so: list(ACTIVE_DIRECTORY_RIGHTS(65536 | 64)) # Returns [Delete, DeleteTree] So in this case calls like this: def to_list(self):
cls = self.__class__
members, _ = enum._decompose(cls, self._value_)
filtered_members = []
for member in members:
found = False
for n in members:
if n & member and n != member:
found = True
if not found:
filtered_members.append(member)
return members We should just be able to do: def to_list(self):
return list(self._value_) Obviously, legacy supporting python <= 3.11 is a bit of a hassle :/ maybe something like this is fine: def to_list(self):
try:
return list(self._value_)
except TypeError:
# Can't use the new python3.11 syntax, so we have to do it the old way
pass
cls = self.__class__
members, _ = enum._decompose(cls, self._value_)
filtered_members = []
for member in members:
found = False
for n in members:
if n & member and n != member:
found = True
if not found:
filtered_members.append(member)
return members |
Hi, Facing the same issue as well Thanks! |
Hi!
|
@OfekShushan You shouldn't really be touching package owned source code. If you need to use python3.11 now most people have been having no issues with the version in my PR. |
Hey pardon the newb question, but in a Kali environment where Python3.11 comes as default, how do I get Certipy running as cleanly as possible while leaving 3.11 as the "dominant" installed version? I've tried going into a venv and compiling python3.10 and reinstalling Certipy with 3.10 but I still always get the |
Atm you can use the fork until ly4k reviews and merges changes: git clone https://github.com/f3rn0s/Certipy
cd Certipy
pip install . If you want a venv it would go something like git clone https://github.com/f3rn0s/Certipy
cd Certipy
python -m venv venv
source venv/bin/activate
pip install . |
That worked thanks! |
+1 |
Fixed since the patch by @f3rn0s got merged. Closing. |
that's great worked for me also |
At the moment, Certipy is not compatible with Python 3.11.
This is because it uses the undocumented
_decompose
function of theenum
module, which apparently got removed in Python 3.11. When running under this version of Python, the following error is shown:The problematic function calls are in
certipy/lib/structs.py
andcertipy/lib/constants.py
.The text was updated successfully, but these errors were encountered: