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

fix to work with python3 #162

Merged
merged 5 commits into from
Mar 17, 2016
Merged

fix to work with python3 #162

merged 5 commits into from
Mar 17, 2016

Conversation

laurentperrinet
Copy link
Contributor

tries to solve #160

tested with python 2.7.9 and 3.4.3

(sorry my editor automatically "cleaned" spaces - I fixed that)

@Zulko
Copy link
Owner

Zulko commented May 1, 2015

Hey there, can you explain the changes in mplfig_to_npimage ?

@laurentperrinet
Copy link
Contributor Author

To port moviepy's code to python 3, a difference is that strings are now represented as unicode and data as bytes while this was different (and sometimes problematic) in python 2:

https://docs.python.org/3.3/whatsnew/3.0.html#text-vs-data-instead-of-unicode-vs-8-bit

This was already implemented in matplotlib, trying to make this backportable with python 2.7, see for instance

matplotlib/matplotlib@f4fee35

in fact, there is no change to the API, but the correct backend has to be called.

basically, what I am doing here is to call for the correct backend (Agg) before calling the same functions and return a numpy array.

hope it is a bit clearer, I am still learning my way to help contribute to the libraries that I use.

@laurentperrinet
Copy link
Contributor Author

laurentperrinet commented Oct 14, 2015

I still have problems rendering movies in a notebook using python 3 - see https://laurentperrinet.github.io/sciblog/posts/2015-04-26-moviepy-and-python3.html - do you have the same problem?
cheers!

@Zulko
Copy link
Owner

Zulko commented Oct 14, 2015

I didn't have time to look into this (im still on Python 2 in my notebooks), now its unclear, does the commit actually solves the problem ?

@laurentperrinet
Copy link
Contributor Author

Yes the commit solves the problem in py3k - and should be back-portable with python 2.7 and higher.

@flothesof
Copy link
Contributor

Hi everyone,

I would like to add that I have encountered the same problem than @Meduz. Would it be possible to accept the PR so as to fix this problem with Python 3?

Best regards,

Florian

@Krastanov
Copy link

Any progress on this?

Zulko added a commit that referenced this pull request Mar 17, 2016
fix to work with python3
@Zulko Zulko merged commit d4c9c37 into Zulko:master Mar 17, 2016
@Zulko
Copy link
Owner

Zulko commented Mar 17, 2016

Sorry for being slow. Too bad moviepy doesn't have a test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants