Skip to content

Stone Age retro compatibility

Compare
Choose a tag to compare
@deajan deajan released this 18 Apr 10:17
· 192 commits to master since this release

Well this release mainly adds Python 2.7 retrocompatibility, even if it's totally out of date.
Why ? In order to fit some elder appliances where upgrading Python isn't just an option.

On top of the stone age compatibility, a couple of improvements / fixes made it into this release:

delayed_keyboardinterrupt

  • Added basic unit test

file_utils

  • grep() now has an ignorecase option

mailer

  • Refactored the whole code into a easy to use class (compatibility kept with wrapper)
  • Refactored TLS code to make it non redundant
  • Added missing MIME headers (date, messageID) which improves non-spam score
  • Added missing charset (defaults to utf-8 obviously) for subjet and headers
  • Fixed mail splitting for bulk sending

network

  • Refactored test_http_internet() & get_public_ip() server reach code (is now shared code)
  • Updated get_public_ip() fetch APIs

logger_utils

  • Added a ContextFilter class wihch "automagically" fixes Python 2 non-unicode logging issues
  • Added safe_string_convert() used by the ContextFilter to deal with non-unicode strings in Python 2
  • Added unit tests

string_handling

  • Changed strip_non_alnum_characters() to also exclude '-' (also making the regex Python 2 compatible)