vivithemage / mrisa

MRISA - Meta reverse image search api
http://mrisa.mage.me.uk/
GNU General Public License v2.0
266 stars 63 forks source link

Client.py - StringIO is deprecated in Python 3 + a suggestion #11

Closed jimlynnjulian closed 6 years ago

jimlynnjulian commented 6 years ago

The following code is from the server script. You may want to add to the client script or do the replacements listed. I don't know if io works with older python versions, so for dual compatibility, the 'try' code may be better. Unfortunately, there's no 'PyVer' version reconciliation module to treat compatibility issues. Seems like a 'no brainer'. CODE try: from StringIO import StringIO except ImportError: python3 = True import io as bytesIOModule END CODE

Replace : storage = StrinIO.StrinIO() with : storage = io.BytesIO() and import io instead of StringIO additionally add parentheses for print statement. The suggestion: if possible, add the section on Google's return page, entitlesd "Pages that include matching images." This would create the possibility of searching for larger format images, e.x. 2048x1024.

vivithemage commented 6 years ago

Hi jimlynnjulian,

Thanks for the details, I'll put that on my todo list and take a look at adding the code along with the "Pages that include matching images." section.

Thanks again.

phanirithvij2000 commented 6 years ago

@jimlynnjulian @vivithemage I did it and made a pull request please have a look at it.