Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError first time doing anything with Python need some help #69

Open
Despirited opened this issue Jan 6, 2025 · 2 comments

Comments

@Despirited
Copy link

Despirited commented Jan 6, 2025

I have exported both my movies and my shows from Trakt, I managed to successfully import all the movies but when I try to import my shows I get this error

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 7868: character maps to

I have no idea what the issue is, the CSV I exported is this:
episodes_views.csv

Here is the entire message I got:

Options: Namespace(config='config.ini', input=<_io.TextIOWrapper name='episodes_views.csv' mode='r' encoding='cp1252'>, watched_at=True, rated_at=False, format='imdb', type='episodes', list='history', seen=False, clean=False, verbose=True)
Config file: config.ini
Config: <configparser.ConfigParser object at 0x00000239A28707D0>
Trakt, skipped access token refresh, token is less than 30 days, only 1:06:27.085743
Trakt: {'client_id': '02....05', 'client_secret': '64....33', 'access_token': 'fa....74', 'refresh_token': '1a....ee', 'baseurl': 'https://api.trakt.tv'}
Authorization header: Bearer fa....74
trakt-api-key header: 02....05
Traceback (most recent call last):
  File "C:\Python312\import_trakt.py", line 517, in <module>
    main()
  File "C:\Python312\import_trakt.py", line 449, in main
    read_ids = read_csv(options)
               ^^^^^^^^^^^^^^^^^
  File "C:\Python312\import_trakt.py", line 154, in read_csv
    return list(reader)
           ^^^^^^^^^^^^
  File "C:\Python312\Lib\csv.py", line 116, in __next__
    row = next(self.reader)
          ^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 7868: character maps to <undefined>
@xbgmsharp
Copy link
Owner

xbgmsharp commented Jan 6, 2025 via email

@Despirited
Copy link
Author

I just tried on Python311 and I am still getting the same error just on a different position, instead of 7868 it's now in position 7975.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants