Benny- / Yahoo-ticker-symbol-downloader

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

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position .... #19

Closed olejardamir closed 7 years ago

olejardamir commented 7 years ago

Exporting Stock symbols Traceback (most recent call last): File "/usr/local/bin/YahooTickerDownloader.py", line 147, in main() File "/usr/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 1543: ordinal not in range(128)

aandragk commented 7 years ago

Same Problem for me. Maybe an Issue with Python2. Try to use Python3 or put this on top of the YahooTickerDownloader.py file.

import sys
reload(sys)
sys.setdefaultencoding("utf-8")
Benny- commented 7 years ago

@olejardamir , was it a python2 problem? Is it resolved now?

olejardamir commented 7 years ago

Yes that is what it was. A second problem was reading the compressed file once the download completed. Sorry for not replying, I simply did not have time.

On Wed, Feb 1, 2017 at 8:11 PM, Benny Jacobs notifications@github.com wrote:

@olejardamir https://github.com/olejardamir , was it a python2 problem? Is it resolved now?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Benny-/Yahoo-ticker-symbol-downloader/issues/19#issuecomment-276835858, or mute the thread https://github.com/notifications/unsubscribe-auth/AD2cazGjON9bUgcguV-aSem9ZYA28EuLks5rYS1TgaJpZM4Lbr5t .