OSError: [Errno 30] Read-only file system when trying to open PDF in Python Code by Zapier

OSError: [Errno 30] Read-only file system when trying to open PDF in Python Code by Zapier

我正在 Zapier 中创建一个 zap,用于搜索特定客户端,然后在 Google Drive 中找到他们的文件夹。然后它从 Google 驱动器文件夹中获取 PDF 文档并上传到 HelloSign 以发送给客户端。我正在使用 Zapier 的代码步骤从 Google 驱动器中提取 PDF 并上传到 HelloSign。

我在 Code by Zapier 步骤中的代码在我的本地计算机上运行,​​但是当我尝试在 Zapier 中 运行 它时,我得到“OSError:[Errno 30] Read-only file system”我正在尝试创建的文档,以便我可以阅读具有“with open('Test.pdf','wb') as f”的行的 PDF。从阅读 another comment 来看,这听起来像是由于 Zapier 权限不允许在其系统上创建文件引起的。出错的代码块非常简单。

output = {'status_code' : ''}

key = 'xxxxxxxx'

url = 'https://' + key + ':@api.hellosign.com/v3/signature_request/send'

response = requests.get(input['pdf'])
with open('Test.pdf','wb') as f:
    pdf = f.write(response.content)

files = {
    'Doc' : pdf
}

param = {
    'test_mode' : 1,
    'title' : "Test from HelloSign",
    'subject' : "Doc Ready",
    'message' : 'Hi! Please sign the attached doc.',
    'signing_redirect_url' : 'https://www.google.com/',
    'signers[0][name]' : input['name'],
    'signers[0][email_address]' : input['email']
    }

r = requests.post(url=url,files = files, params=param)

output['status_code'] = r.status_code

我有什么替代方法可以在不使用 open() 的情况下阅读 PDF,以便我可以将 PDF 传递给 HelloSign 发送?

这应该有效

output = {'status_code' : ''}

key = 'xxxxxxxx'

url = 'https://' + key + ':@api.hellosign.com/v3/signature_request/send'

response = requests.get(input['pdf'])

files = {
    'file' : response.content
}

param = {
    'test_mode' : 1,
    'title' : "Test from HelloSign",
    'subject' : "Doc Ready",
    'message' : 'Hi! Please sign the attached doc.',
    'signing_redirect_url' : 'https://www.google.com/',
    'signers[0][name]' : input['name'],
    'signers[0][email_address]' : input['email']
    }

r = requests.post(url=url,files = files, params=param)

output['status_code'] = r.status_code