upload_video: 'string argument detected, got 'bytes' #422
Labels
No labels
Bug
Enhancement
Feature Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: code/twython#422
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I first tried the following on Python 3.4 and Twython 3.4:
video = open(tempfile_name, 'rb')response = twitter.upload_video(media=video, media_type='video/mp4')and received an error:
media_chunk.write(data)TypeError: string argument expected, got 'bytes'I think using StringIO in Python3 instead of BytesIO in
upload_videoinendpoints.pyled to this issue; on endpoints.py I changed the python3 importfrom io import StringIO(i.e. if StringIO.StringIO not found) tofrom io import BytesIOandupload_videonow works with my last attempt (with the tempfile).Following twython video upload docs still results in
TypeError: string argument expected, got 'bytes'Any valid way to upload a post with video via Twython?