joenano / rpscrape

Scrape horse racing results data and racecards.
140 stars 57 forks source link

UnicodeEncodeError: 'charmap' codec can't encode characters #86

Closed patem2 closed 2 years ago

patem2 commented 2 years ago

Hi,

When trying to run the racecards,py file this morning it's generating the following error:

Traceback (most recent call last): File "racecards.py", line 404, in main() File "racecards.py", line 400, in main f.write(dumps(races).decode('utf-8')) File "C:\Users\markp\anaconda3\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 198016-198017: character maps to

Thanks in advance for your support.

joenano commented 2 years ago

I cant replicate the error but have added encoding when opening the file to write, that might be the issue.