当我尝试通过 suds 方法发送 Zipfile 内容时出现以下错误
'ascii' codec can't decode byte 0x8c in position 10: ordinal not in range(128)
这是我的代码:
try:
project_archive = open(os.path.join(settings.MEDIA_ROOT, 'zip/project.zip'), "rb")
data = project_archive.read()
client = Client(settings.UPLOAD_PROJECT_WS_URL)
client.service.uploadProject(data)
except Exception as e:
return HttpResponse(e)
else:
return HttpResponse("Project was exported")