Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace 'tostring' by 'tobytes' in 'video.io.gif_writers::write_gif' #1429

Merged
merged 2 commits into from
Jan 13, 2021

Conversation

mondeja
Copy link
Collaborator

@mondeja mondeja commented Jan 12, 2021

The method array.tostring was deprecated in Python v3.2, being replaced by array.tobytes, so I've just changed their name. This method it's removed in Python 3.9 (Release notes) and the change prevents next warning:

/.../moviepy/video/io/gif_writers.py:323: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.

@tburrows13
Copy link
Collaborator

Done in #1365 and #1354 :)

@mondeja
Copy link
Collaborator Author

mondeja commented Jan 12, 2021

Done in #1365 and #1354 :)

Ups 😅 Thank you for pointing it, any chance of merging the changes? I would like to use moviepy in Python3.9 without worries :)

@mondeja mondeja closed this Jan 12, 2021
@tburrows13
Copy link
Collaborator

tburrows13 commented Jan 12, 2021

I didn't merge them because I was hesitant about the performance/memory impact of changing the yield into a return and I hadn't had time to properly investigate. I suspect that there's nothing that can be done about it.

@mondeja
Copy link
Collaborator Author

mondeja commented Jan 12, 2021

Could you consider this change separately? This breaks GIF creation in Python3.9 but the other deprecation even with latest Numpy can be ignored.

@tburrows13 tburrows13 added the bug-fix For PRs and issues solving bugs. label Jan 13, 2021
@tburrows13
Copy link
Collaborator

Yes certainly. Feel free to merge this PR.

@mondeja mondeja reopened this Jan 13, 2021
@mondeja mondeja merged commit 09de608 into Zulko:master Jan 13, 2021
@mondeja
Copy link
Collaborator Author

mondeja commented Jan 14, 2021

This has fixed second warning of #1338.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix For PRs and issues solving bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants