文件上载 服务器错误,在dropbox python api中使用“文件”上载文件时发生内部服务器错误...

我正在尝试使用python dropbox中的files_upload方法将本地csv文件上载到dropbox帐户api。它引发内部服务器错误。以前,它是有效的好吧。下面是我的密码。在import dropbox

from dropbox.files import WriteMode

from dropbox.exceptions import ApiError, AuthError

d = dropbox.Dropbox('xxxxxxxxx')

with open(pricing_plan_unit_no_data_csv_path, 'rb') as f:

# We use WriteMode=overwrite to make sure that the settings in the file

# are changed on upload

BACKUPPATH = '/IH_Permit_and_Title_processing/Title_input_for_KNIME/' + lastmonth.strftime("%m_%Y") + '/' + 'plan_unit_'+lastmonth.strftime("%m_%Y")+'_nodata.csv'

print("Uploading " + pricing_plan_unit_no_data_csv_path + " to Dropbox as " + BACKUPPATH + "...")

try:

d.files_upload(f.read(), BACKUPPATH, mode=WriteMode('overwrite'))

f.close()

except ApiError as err:

# This checks for the specific error where a user doesn't have

# enough Dropbox space quota to upload this file

if (err.error.is_path() and err.error.get_path().error.is_insufficient_space()):

sys.exit("ERROR: Cannot back up; insufficient space.")

elif err.user_message_text:

print(err.user_message_text)

sys.exit()

else:

print(err)

sys.exit()

以下是错误

^{pr2}$

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值