Warning handled for Python3: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.