我正在尝试使用以下代码连接到Sharepoint。它以前工作,但突然停止工作,现在显示以下错误:
File "C:\Users\Documents\Anaconda2\lib\site-packages\office365\runtime\auth\saml_token_provider.py", line 67, in get_authentication_cookie
return 'FedAuth=' + self.FedAuth + '; rtFa=' + self.rtFa
TypeError:无法连接“str”和“NoneType”对象
^{pr2}$如果ctx_用户的身份验证获取令牌(用户名、密码):
print("Authentication with SharePoint was successful: {0}".format(
ctx_auth.acquire_token_for_user(username, password)))
ctx = ClientContext(url, ctx_auth)
web = ctx.web
ctx.load(web)
ctx.execute_query()
print "SharePoint Site: {0}".format(web.properties['Title'])
其他: 打印ctx_auth.get_last_错误()
它在这条线上失败了:
ctx.execute_query()
我一直在使用sharepy库作为连接到Sharepoint的替代解决方案。
使用pip install sharepy安装模块。在
认证成功后,应打印出以下内容:
相关问题 更多 >
编程相关推荐