from pprint import pprint
from atlassian import Confluence
confluence = Confluence(
url='xxx',
username='xxx',
password='xxx')
status = confluence.update_page(
parent_id=22028117,
page_id=38284221,
title='',
body='<h1 id="WindowsSignatureSet2.4.131.3-2-HandoffinstructionstoOperations">Handoff instructions to Operations</h1>',
)
print(status)
尝试更新汇合页面时获取以下错误。直到昨天它工作正常。出了什么问题?
Traceback (most recent call last):
File "con_update.py", line 37, in
parent_id=22028117
File "C:\Python36-32\lib\site-packages\atlassian\confluence.py", line 76, in update_page
'version': {'number': version}})
File "C:\Python36-32\lib\site-packages\atlassian_init_.py", line 57, in put
return self.request('PUT', path=path, data=data, headers=headers).json()
File "C:\Python36-32\lib\site-packages\atlassian_init_.py", line 42, in request
response.raise_for_status()
File "C:\Python36-32\lib\site-packages\requests\models.py", line 851, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error
答案 0 :(得分:0)
您没有发送增加的版本号。对于更新过程,您必须将版本号增加1。
from pprint import pprint
from atlassian import Confluence
confluence = Confluence(
url='xxx',
username='xxx',
password='xxx')
status = confluence.update_page(
parent_id=22028117,
page_id=38284221,
title='',
version=x,//latest version number+1
body='<h1 id="WindowsSignatureSet2.4.131.3-2-HandoffinstructionstoOperations">Handoff instructions to Operations</h1>',
) print(status)