impacket icon indicating copy to clipboard operation
impacket copied to clipboard

Fixed warnings with Python 3.12

Open exploide opened this issue 1 year ago • 5 comments
trafficstars

  1. 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 of SyntaxWarning: invalid escape sequence.

  2. The function datetime.datetime.utcnow() has been deprecated, because timezone aware datetime objects should better be used instead. Replaced a lot of occurences of datetime.datetime.utcnow() in the codebase since this was spitting DeprecationWarning: datetime.datetime.utcnow() is deprecated everywhere.

exploide avatar Feb 03 '24 17:02 exploide

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.

anadrianmanrique avatar Feb 06 '24 20:02 anadrianmanrique

Great. Pushed another commit, because datetime.datetime.utcfromtimestamp() is deprecated likewise.

exploide avatar Feb 09 '24 18:02 exploide