-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix various Python 3.12 SyntaxWarning #5538
Fix various Python 3.12 SyntaxWarning #5538
Conversation
Thanks! I wonder what these changes mean for Python 2? Most of these scripts use just @exploide Can you please take a look? |
So the changes look fine in general. Compatibility, also with Python 2, should not be an issue since the syntax stayed the same but Python 3.12+ is stricter and emits a warning when it comes to backslash sequences. That means if a string contains a backslash it must be a valid escape sequence like There are only two things I would like to double-check.
Unfortunately, we have no test files for any of the formats in john-samples. But since @elboulangero found these warnings, you probably have some test files? Can you please retest especially the two mentioned scripts or at least justify that you are sure it works this way? |
Thank you very much @exploide for such a thorough review! @elboulangero This reminds me, if you have any sample/test inputs you could publish, please submit those to our john-samples repo via a pull request. Thank you! |
Thanks for the quick feedback. First, I can share the warnings that I get with Python 3.12, and that are fixed with this PR:
For this one, I think that just printing the two strings (before and after turning it in a raw string), is enough to show that there was no change:
In fact, I saved the two outputs in two files and then compared them, otherwise it's not possible to really say if there's a difference.
You are surely right on that, I updated the PR to use
No, I don't have tests unfortunately. I'm part of Kali Linux team, and Python 3.12 is the new default in Kali, it's about to hit Kali Rolling later today if all goes well. We see those warnings when the But no, I don't have specific tests, sorry. It's Ok if you don't want to merge this PR, if you think the changes can't be included without more extended testing. Also, we do run all the tests as part of our CI pipelines, and at the moment the tests run only against Python 3.12. We don't test Python 2. |
I think it's fine and ready to merge as soon as you push the |
Yes, I'd like to merge this based on the discussion so far. For the one pending change above, please amend and force-push the one existing commit, not add an extra commit. Thanks! |
6a33bcd
to
e324749
Compare
Ah indeed, I forgot to push, thanks for the nudge. Now it's done and ready to merge I think. |
No description provided.