use encodebytes for Python 3 to avoid DeprecationWarning
Merge branch 'piotrbulinski-develop' into develop

* piotrbulinski-develop:
  use encodebytes for Python 3 to avoid DeprecationWarning