我有一个简单的 spyne 服务:
class JiraAdapter(ServiceBase):
@srpc(Unicode, String, Unicode, _returns=Status)
def CreateJiraIssueWithBase64Attachment(summary, base64attachment, attachment_filename):
status = Status
try:
newkey = jira_client.createWithBase64Attachment(summary, base64attachment, attachment_filename)
status.Code = StatusCodes.IssueCreated
status.Message = unicode(newkey)
except Exception as e:
status.Code = StatusCodes.InternalError
status.Message = u'Internal Exception: %s' % e.message
return status
问题是一些程序会在每 60 个字符左右插入 '\n' 到生成的 base64string 中,并且它会进入服务的方法,转义('\\n')导致事情表现得很奇怪。有没有设置或什么可以避免这种情况?