The marshal.dumps and marshal.loads functions should return and accept bytes, respectively, rather than a string.