collectd-haproxy icon indicating copy to clipboard operation
collectd-haproxy copied to clipboard

Add Python 3 support

Open jonyesno opened this issue 4 years ago • 0 comments

This MR:

  • encodes/decodes strings to/from bytes when talking to the HAProxy socket
  • tweaks the tryexcept syntax

both of which make the plugin work under Python 3.

This addresses the following logged exceptions:

Unhandled python exception in importing module: SyntaxError: invalid syntax
Unhandled python exception in read callback: TypeError: a bytes-like object is required, not 'str'
Unhandled python exception in read callback: TypeError: must be str, not bytes

Disclaimer: my Python skills are very limited, but this fixed it for me.

jonyesno avatar Aug 04 '20 05:08 jonyesno