-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fixed warnings with Python 3.12 #1695
Conversation
Thanks for the PR with changes. Although we are not currently supporting officially 3.12, we will do it in the short term. This PR will be taken into account by then. |
Great. Pushed another commit, because |
…ed in Python 3.12+
…s deprecated in Python 3.12+
Just rebased this PR to master and fixed further incarnations of the warnings introduced in Now that impacket 0.12.0 is out, I think it's a good time to get rid of the annoying warnings when using Python 3.12. |
sudo apt update" python3 --version
sudo git clone https://github.com/fortra/impacket /opt/impacket
/usr/bin/b4bloodV4:84: SyntaxWarning: invalid escape sequence '\ '
/usr/bin/b4bloodV4:235: SyntaxWarning: invalid escape sequence '\d'
/usr/bin/b4bloodV4:382: SyntaxWarning: invalid escape sequence '|'
/usr/bin/b4bloodV4:432: SyntaxWarning: invalid escape sequence '|' Line 432:
|
@sec13b The only warning shown in your output which concerns impacket is the All other warnings you show belong to b4blood and have nothing to do with impacket. By the way, this doesn't really make sense:
First you clone impacket from GitHub, then you install the impacket version shipped by the Kali repository. You need to decide whether you want to use the latest development version from GitHub or the package from the Kali repository. And please consider wrapping your output in
the next time, which makes the output easier to read. |
merging this one. Thanks @exploide for the PR! |
Python 3.12 is a bit more strict when it comes to backslashes in strings. If it isn't an actual escape sequence like
\n
then it should be either a raw string or the backslash should be escaped. Fixed a bunch ofSyntaxWarning: invalid escape sequence
.The function
datetime.datetime.utcnow()
has been deprecated, because timezone aware datetime objects should better be used instead. Replaced a lot of occurences ofdatetime.datetime.utcnow()
in the codebase since this was spittingDeprecationWarning: datetime.datetime.utcnow() is deprecated
everywhere.