ryelogheat / xpbot

Analyze a media file, identify the TMDB/IMDB, and generate all the necessary info to upload a torrent to a private tracker using the UNIT3D codebase
55 stars 27 forks source link

'charmap' codec can't encode character #17

Closed mesoller closed 3 years ago

mesoller commented 3 years ago

How to fix this error? Re-installed Python to latest version 3.9.5 doesn't solve the issue.

c:\xpbot\auto_upload.py:1893 in <module> │ │ │ │ 1890 │ │ │ │ │ description.write(line) │ │ 1891 │ │ │ │ │ │ 1892 │ │ │ │ # Finally append the entire thing with some shameless self promotion ;) │ │ > 1893 │ │ │ │ description.write(f' {bbcode_line_break}{bbcode_line_break} Uploaded wit │ │ 1894 │ │ │ │ │ 1895 │ │ │ # Add the finished file to the 'torrent_info' dict │ │ 1896 │ │ │ torrent_info["description"] = f'{working_folder}/temp_upload/description.txt │ │ │ │ C:\Python38\lib\encodings\cp1252.py:19 in encode │ │ │ │ 16 │ │ 17 class IncrementalEncoder(codecs.IncrementalEncoder): │ │ 18 │ def encode(self, input, final=False): │ │ > 19 │ │ return codecs.charmap_encode(input,self.errors,encoding_table)[0] │ │ 20 │ │ 21 class IncrementalDecoder(codecs.IncrementalDecoder): │ │ 22 │ def decode(self, input, final=False): │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ UnicodeEncodeError: 'charmap' codec can't encode character '\u2764' in position 39: character maps to <undefined>

mesoller commented 3 years ago

There is some encoding issue on line 1893 messed up auto_upload.py. For now, I'm omitted this line.

ryelogheat commented 3 years ago

issue is the emoji in that line, you can rewrite the little message I put there however you want or remove it outright. Shouldn't affect the actual upload process.