Skip to content
This repository was archived by the owner on Dec 27, 2018. It is now read-only.
This repository was archived by the owner on Dec 27, 2018. It is now read-only.

ValueError with attachment list #22

Description

@macotine

It appears when I pass a list of dictionaries to create_new_attachment_by_content_id I get an assertion error when the request is built.

The structure of the list is:
[{'file': file1}, {'file': file2}, {'file': file3}]

Stack trace:

self.confluence.create_new_attachment_by_content_id(content_id, attachments)
  File "C:\dev\Python27\lib\site-packages\pythonconfluenceapi-0.0.1rc4-py2.7.egg\PythonConfluenceAPI\api.py", line 813, in create_new_attachment_by_content_id
  File "C:\dev\Python27\lib\site-packages\pythonconfluenceapi-0.0.1rc4-py2.7.egg\PythonConfluenceAPI\api.py", line 133, in _service_post_request
  File "C:\dev\Python27\lib\site-packages\pythonconfluenceapi-0.0.1rc4-py2.7.egg\PythonConfluenceAPI\api.py", line 109, in _service_request
  File "C:\dev\Python27\lib\site-packages\requests\sessions.py", line 451, in request
    prep = self.prepare_request(req)
  File "C:\dev\Python27\lib\site-packages\requests\sessions.py", line 382, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "C:\dev\Python27\lib\site-packages\requests\models.py", line 307, in prepare
    self.prepare_body(data, files, json)
  File "C:\dev\Python27\lib\site-packages\requests\models.py", line 453, in prepare_body
    (body, content_type) = self._encode_files(files, data)
  File "C:\dev\Python27\lib\site-packages\requests\models.py", line 132, in _encode_files
    for (k, v) in files:
ValueError: need more than 1 value to unpack

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions