You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.
I'm using update_attachment to upload a new version of an image attachment.
I can upload the file, but when I include the comments or minorEdit in the attachment metadata, the requests library treats it like a file to be uploaded.
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PythonConfluenceAPI/api.py", line 1048, in update_attachment
callback=callback)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PythonConfluenceAPI/api.py", line 140, in _service_post_request
return self._service_request("POST", *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PythonConfluenceAPI/api.py", line 114, in _service_request
response = self.session.request(request_type, uri, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 474, in request
prep = self.prepare_request(req)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 407, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/models.py", line 305, in prepare
self.prepare_body(data, files, json)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/models.py", line 483, in prepare_body
(body, content_type) = self._encode_files(files, data)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/models.py", line 158, in _encode_files
fdata = fp.read()
Problem is that the attachment dict is passed straight to the requests library, and all items are treated as files. It tries to upload "minorEdit" and fails because it's a bool.
Is there a way to separate the attachment metadata from the attachment data itself in this call?
Thanks,
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I'm using update_attachment to upload a new version of an image attachment.
I can upload the file, but when I include the comments or minorEdit in the attachment metadata, the requests library treats it like a file to be uploaded.
Error thread:
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PythonConfluenceAPI/api.py", line 1048, in update_attachment
callback=callback)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PythonConfluenceAPI/api.py", line 140, in _service_post_request
return self._service_request("POST", *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PythonConfluenceAPI/api.py", line 114, in _service_request
response = self.session.request(request_type, uri, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 474, in request
prep = self.prepare_request(req)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 407, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/models.py", line 305, in prepare
self.prepare_body(data, files, json)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/models.py", line 483, in prepare_body
(body, content_type) = self._encode_files(files, data)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/models.py", line 158, in _encode_files
fdata = fp.read()
Problem is that the attachment dict is passed straight to the requests library, and all items are treated as files. It tries to upload "minorEdit" and fails because it's a bool.
Is there a way to separate the attachment metadata from the attachment data itself in this call?
Thanks,
The text was updated successfully, but these errors were encountered: