sensiblecodeio / scraperwiki-python

ScraperWiki Python library for scraping and saving data
https://scraperwiki.com
BSD 2-Clause "Simplified" License
160 stars 69 forks source link

Python3 unicode #100

Open MaxKurama opened 8 years ago

MaxKurama commented 8 years ago

In python3 we do not have unicode strings, so we do not need to decode them.

pwaller commented 8 years ago

This fix is not quite right and will make successful running conditional on the system configuration.

A better fix would be to specify the encoding on the NamedTemporaryFile(*, encoding="utf-8"). Then rather than trying to .decode you can instead just get rid of the .decode. This will then work correctly on both python 2 & 3 and independently of system configuration variables such as LC_CTYPE and PYTHONIOENCODING.