Benny- / Yahoo-ticker-symbol-downloader

A web scraper for ticker symbols from yahoo finance
https://pypi.python.org/pypi/Yahoo-ticker-downloader/
Other
247 stars 87 forks source link

Please add utf8 default coding #23

Closed manzikki closed 7 years ago

manzikki commented 7 years ago

After download, writing the files fails: File "/home/ubuntu/.local/bin/YahooTickerDownloader.py", line 135, in main f.write(data.csv.encode('UTF-8')) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1233: ordinal not in range(128)

This can be avoided by:

import sys

.. def main(): reload(sys)
sys.setdefaultencoding('utf8')

Benny- commented 7 years ago

This is a good solution for issue #16

Benny- commented 7 years ago

Resolved in b22a1629918f0198fabb8e5f4676f3c6ca273d6a