cast non-bytes arguments to bytes in python3 spool api