Skip to content

'str' does not support the buffer interface #216

@jonfen

Description

@jonfen

The uploads portion of the following example code fails with the error above for both create() and save(), removing the uploads assignment makes the call successful, but not valuable:

https://python-redmine.com/resources/issue.html?highlight=stringio

from io import StringIO
issue = redmine.issue.create(
     project_id='vacation',
     subject='Vacation',
     tracker_id=8,
     description='foo',
     status_id=3,
     priority_id=7,
     assigned_to_id=123,
     watcher_user_ids=[123],
     parent_issue_id=345,
     start_date=datetime.date(2014, 1, 1),
     due_date=datetime.date(2014, 2, 1),
     estimated_hours=4,
     done_ratio=40,
     custom_fields=[{'id': 1, 'value': 'foo'}, {'id': 2, 'value': 'bar'}],
     uploads=[{'path': '/absolute/path/to/file'}, {'path': StringIO('I am content of file 2')}]
)

produces error: 'str' does not support the buffer interface

Redmine Server: 3.2.0
Python: 3.3
OS: Windows 10 Pro

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions