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

tostring() has been deprecated #38

Merged
merged 1 commit into from
Feb 10, 2016
Merged

tostring() has been deprecated #38

merged 1 commit into from
Feb 10, 2016

Conversation

rajathkmp
Copy link
Contributor

Solves the error :

Exception: tostring() has been removed. Please call tobytes() instead.

Solves the error : 

```
Exception: tostring() has been removed. Please call tobytes() instead.
```
@tboggs
Copy link
Member

tboggs commented Jan 23, 2016

Thanks for the pull request. This fixes the call for the Pillow fork but do you know if it breaks compatibility with PIL under Python 2 and/or 3?

@rajathkmp
Copy link
Contributor Author

@tboggs I have used python2 haven't tested with python3.

@tboggs
Copy link
Member

tboggs commented Jan 25, 2016

I'm not too worried about python3 at this point (there are other compatibility issues that will need to be fixed first) but I don't want to break compatibility with PIL (possibly older versions). Could you revise your pull request to fall back to tostring in case tobytes fails? Perhaps something like this:

try:
    img = images[i].tobytes("raw", "RGBX", 0, -1)
except:
    img = images[i].tostring("raw", "RGBX", 0, -1)

I'll open an issue and use your pull request to close it. To close the bug with the pull request, perhaps you could apply your fix to the two other locations where tostring is used (once each in rasterwindow.py and spywxpythonthread.py).

Thanks,
Thomas

@rajathkmp
Copy link
Contributor Author

@tboggs Sure thing.

tboggs added a commit that referenced this pull request Feb 10, 2016
tostring() has been deprecated (see issue #39).
@tboggs tboggs merged commit 1df16ad into spectralpython:master Feb 10, 2016
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.

2 participants