p4cx / pocketbook_dic

Create a dictionary for your pocketbook with data from dict.cc
MIT License
2 stars 2 forks source link

Scipt aborts #2

Open fritz-fisch opened 1 month ago

fritz-fisch commented 1 month ago

Good morning and thanks for this fine tool.

I tried to run it with the latest language files both in EN-DE and ES-DE on python 3-13 and it aborts after approx 15 sec. with errors like the one below.

Deleting a few lines of the source file to get rid of the apparently offending character halts the script a few lines farther down on the source file.

any idea what might be wrong?

Thanks and regards

===================

Avenue des Champs-Élysées | Avenue des Champs-Élysées

(die) Beeren spülen to rinse the berries (with water) verb [gastr.]

Beeren spülen | to rinse the berries Traceback (most recent call last): File "C:\python\dict\parser.py", line 68, in parse_txt_to_db(txt, connect)


  File "C:\python\dict\parser.py", line 19, in parse_txt_to_db
    for line_num, line in enumerate(fh):
                          ~~~~~~~~~^^^^
  File "C:\python\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 0x81 in position 4501: character maps to <undefined>
p4cx commented 1 month ago

Nice to see somebody using my code. I will put it on my TODO to check this issue out, it seems to not be able to parse special characters like the E's with hats: Élysées.

fritz-fisch commented 1 month ago

Hi Pascal

will check github in a few weeks for a possibly fixed version.

Thanks already & regards

Fritz

------ Originalnachricht ------ Von "Pascal Eckmann" @.> An "p4cx/pocketbook_dic" @.> Cc "fritz-fisch" @.>; "Author" @.> Datum 23.10.2024 10:35:28 Betreff Re: [p4cx/pocketbook_dic] Scipt aborts (Issue #2)

Nice to see somebody using my code. I will put it on my TODO to check this issue out, it seems to not be able to parse special characters like the E's with hats: Élysées.

— Reply to this email directly, view it on GitHub https://github.com/p4cx/pocketbook_dic/issues/2#issuecomment-2431309186, or unsubscribe https://github.com/notifications/unsubscribe-auth/BMEVYWZIRSGLRNO3KX2YNS3Z45NVBAVCNFSM6AAAAABQATGZTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZRGMYDSMJYGY. You are receiving this because you authored the thread.Message ID: @.***>