scottgigante / korean-support

Anki add-on providing support for Korean study
https://ankiweb.net/shared/info/1336389630
GNU General Public License v3.0
19 stars 5 forks source link

Error message when loading TTS #28

Closed FreyaDC closed 3 years ago

FreyaDC commented 3 years ago

First of all thank you for creating this wonderful add-on, it has helped me out tremendously!

I use the TTS Naver Papago function and it works perfectly. However, almost every time it fetches the audio, I get a pop-up with the following error message.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.40 (cf446733) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-04-03 21:40:22

--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 85-87: character maps to <undefined>
Call stack:
  File "runanki.py", line 4, in <module>
  File "aqt\__init__.py", line 405, in run
  File "aqt\__init__.py", line 574, in _run
  File "aqt\webview.py", line 35, in cmd
  File "aqt\webview.py", line 124, in _onCmd
  File "aqt\webview.py", line 569, in _onBridgeCmd
  File "aqt\editor.py", line 428, in onBridgeCmd
  File "aqt\hooks_gen.py", line 1503, in __call__
  File "anki\hooks.py", line 45, in runFilter
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost
    if updateFields(note, field, allFields):
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields
    update_Sound_fields(fieldsCopy[currentField], fieldsCopy)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields
    s = sound(hangul)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound
    return "[sound:{}]".format(tts.download(text, "ko", service=source))
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 41, in download
    tts = NaverTTS(text, lang=lang, speed=speed, gender=gender)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 114, in __init__
    log.debug("%s: %s", k, v)
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: '%s: %s'
Arguments: ('text', '힘내다')
--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\uff1f' in position 160: character maps to <undefined>
Call stack:
  File "runanki.py", line 4, in <module>
  File "aqt\__init__.py", line 405, in run
  File "aqt\__init__.py", line 574, in _run
  File "aqt\webview.py", line 35, in cmd
  File "aqt\webview.py", line 124, in _onCmd
  File "aqt\webview.py", line 569, in _onBridgeCmd
  File "aqt\editor.py", line 428, in onBridgeCmd
  File "aqt\hooks_gen.py", line 1503, in __call__
  File "anki\hooks.py", line 45, in runFilter
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost
    if updateFields(note, field, allFields):
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields
    update_Sound_fields(fieldsCopy[currentField], fieldsCopy)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields
    s = sound(hangul)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound
    return "[sound:{}]".format(tts.download(text, "ko", service=source))
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 41, in download
    tts = NaverTTS(text, lang=lang, speed=speed, gender=gender)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 114, in __init__
    log.debug("%s: %s", k, v)
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: '%s: %s'
Arguments: ('tokenizer_func', <bound method Tokenizer.run of re.compile('(?<=\\?).|(?<=!).|(?<=?).|(?<=!).|(?<!\\.[a-z])\\. |(?<!\\.[a-z]), |(?<!\\d):|\\(|¿|。|‥|\\)|\\]|¡|\\\n|:|\\[|،|、|—|;|…|,', re.IGNORECASE) from: [<function tone_marks at 0x0000017CD6147820>, <function period_comma at 0x0000017CD6147940>, <function colon at 0x0000017CD61479D0>, <function other_punctuation at 0x0000017CD6147A60>]>)
--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 194-196: character maps to <undefined>
Call stack:
  File "runanki.py", line 4, in <module>
  File "aqt\__init__.py", line 405, in run
  File "aqt\__init__.py", line 574, in _run
  File "aqt\webview.py", line 35, in cmd
  File "aqt\webview.py", line 124, in _onCmd
  File "aqt\webview.py", line 569, in _onBridgeCmd
  File "aqt\editor.py", line 428, in onBridgeCmd
  File "aqt\hooks_gen.py", line 1503, in __call__
  File "anki\hooks.py", line 45, in runFilter
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost
    if updateFields(note, field, allFields):
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields
    update_Sound_fields(fieldsCopy[currentField], fieldsCopy)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields
    s = sound(hangul)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound
    return "[sound:{}]".format(tts.download(text, "ko", service=source))
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 44, in download
    tts.save(path)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 252, in save
    self.write_to_fp(f)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 232, in write_to_fp
    log.debug("part-%i written to %s", idx, fp)
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: 'part-%i written to %s'
Arguments: (0, <_io.BufferedWriter name='C:\\Users\\freya\\AppData\\Roaming\\Anki2\\Freya\\collection.media\\힘내다_N_ko.mp3'>)
--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 144-146: character maps to <undefined>
Call stack:
  File "runanki.py", line 4, in <module>
  File "aqt\__init__.py", line 405, in run
  File "aqt\__init__.py", line 574, in _run
  File "aqt\webview.py", line 35, in cmd
  File "aqt\webview.py", line 124, in _onCmd
  File "aqt\webview.py", line 569, in _onBridgeCmd
  File "aqt\editor.py", line 428, in onBridgeCmd
  File "aqt\hooks_gen.py", line 1503, in __call__
  File "anki\hooks.py", line 45, in runFilter
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost
    if updateFields(note, field, allFields):
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields
    update_Sound_fields(fieldsCopy[currentField], fieldsCopy)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields
    s = sound(hangul)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound
    return "[sound:{}]".format(tts.download(text, "ko", service=source))
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 44, in download
    tts.save(path)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 253, in save
    log.debug("Saved to %s", savefile)
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: 'Saved to %s'
Arguments: ('C:\\Users\\freya\\AppData\\Roaming\\Anki2\\Freya\\collection.media\\힘내다_N_ko.mp3',)

Everything still works fine, so it's just a bit of an inconvenience to have to close the pop-up every time. I don't seem to get the error 100% of the time but let's say it's at least 90%.

Thank you in advance for looking into this!

scottgigante commented 3 years ago

Hi @FreyaDC,

I am currently offline and will be until June. I'll fix it as soon as I can after that - alternatively, if somebody wants to put in the fix I would be happy to accept a pr. Should be pretty easy to sanitize the filename to be unicode safe.

On Sat, 3 Apr 2021, 4:21 pm FreyaDC, @.***> wrote:

First of all thank you for creating this wonderful add-on, it has helped me out tremendously!

I use the TTS Naver Papago function and it works perfectly. However, almost every time it fetches the audio, I get a pop-up with the following error message.

`Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site. Debug info: Anki 2.1.40 (cf446733) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Windows 10 Flags: frz=True ao=True sv=1 Add-ons, last update check: 2021-04-03 21:40:22

--- Logging error --- Traceback (most recent call last): File "logginginit.py", line 1084, in emit File "C:\python\lib\encodings\cp1252.py", line 19, in encode UnicodeEncodeError: 'charmap' codec can't encode characters in position 85-87: character maps to Call stack: File "runanki.py", line 4, in File "aqtinit.py", line 405, in run File "aqtinit.py", line 574, in

run File "aqt\webview.py", line 35, in cmd File "aqt\webview.py", line 124, in onCmd File "aqt\webview.py", line 569, in onBridgeCmd File "aqt\editor.py", line 428, in onBridgeCmd File "aqt\hooks_gen.py", line 1503, in call File "anki\hooks.py", line 45, in runFilter File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost if updateFields(note, field, allFields): File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields update_Sound_fields(fieldsCopy[currentField], fieldsCopy) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields s = sound(hangul) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound return "[sound:{}]".format(tts.download(text, "ko", service=source)) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 41, in download tts = NaverTTS(text, lang=lang, speed=speed, gender=gender) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 114, in init log.debug("%s: %s", k, v) File "logging_init.py", line 1422, in debug File "logging_init.py", line 1577, in log File "logging_init.py", line 1587, in handle File "logging_init.py", line 1649, in callHandlers File "logginginit.py", line 950, in handle File "logginginit.py", line 1183, in emit File "logginginit.py", line 1089, in emit Message: '%s: %s' Arguments: ('text', '힘내다') --- Logging error --- Traceback (most recent call last): File "logginginit.py", line 1084, in emit File "C:\python\lib\encodings\cp1252.py", line 19, in encode UnicodeEncodeError: 'charmap' codec can't encode character '\uff1f' in position 160: character maps to Call stack: File "runanki.py", line 4, in File "aqtinit.py", line 405, in run File "aqtinit.py", line 574, in

run File "aqt\webview.py", line 35, in cmd File "aqt\webview.py", line 124, in onCmd File "aqt\webview.py", line 569, in onBridgeCmd File "aqt\editor.py", line 428, in onBridgeCmd File "aqt\hooks_gen.py", line 1503, in call File "anki\hooks.py", line 45, in runFilter File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost if updateFields(note, field, allFields): File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields update_Sound_fields(fieldsCopy[currentField], fieldsCopy) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields s = sound(hangul) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound return "[sound:{}]".format(tts.download(text, "ko", service=source)) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 41, in download tts = NaverTTS(text, lang=lang, speed=speed, gender=gender) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 114, in init log.debug("%s: %s", k, v) File "logging_init.py", line 1422, in debug File "logging_init.py", line 1577, in log File "logging_init.py", line 1587, in handle File "logging_init.py", line 1649, in callHandlers File "logginginit.py", line 950, in handle File "logginginit.py", line 1183, in emit File "logginginit.py", line 1089, in emit Message: '%s: %s' Arguments: ('tokenizer_func', <bound method Tokenizer.run of re.compile('(?<=\?).|(?<=!).|(?<=?).|(?<=!).|(?<!.[a-z]). |(?<!.[a-z]), |(?<!\d):|(|¿|。|‥|)|]|¡|\n|:|[|،|、|—|;|…|,', re.IGNORECASE) from: [<function tone_marks at 0x0000017CD6147820>, <function period_comma at 0x0000017CD6147940>, <function colon at 0x0000017CD61479D0>, <function otherpunctuation at 0x0000017CD6147A60>]>) --- Logging error --- Traceback (most recent call last): File "logginginit.py", line 1084, in emit File "C:\python\lib\encodings\cp1252.py", line 19, in encode UnicodeEncodeError: 'charmap' codec can't encode characters in position 194-196: character maps to Call stack: File "runanki.py", line 4, in File "aqtinit.py", line 405, in run File "aqtinit_.py", line 574, in

run File "aqt\webview.py", line 35, in cmd File "aqt\webview.py", line 124, in onCmd File "aqt\webview.py", line 569, in onBridgeCmd File "aqt\editor.py", line 428, in onBridgeCmd File "aqt\hooks_gen.py", line 1503, in call File "anki\hooks.py", line 45, in runFilter File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost if updateFields(note, field, allFields): File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields update_Sound_fields(fieldsCopy[currentField], fieldsCopy) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields s = sound(hangul) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound return "[sound:{}]".format(tts.download(text, "ko", service=source)) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 44, in download tts.save(path) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 252, in save self.write_to_fp(f) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 232, in write_to_fp log.debug("part-%i written to %s", idx, fp) File "logging_init.py", line 1422, in debug File "logging_init.py", line 1577, in log File "logging_init.py", line 1587, in handle File "logging_init.py", line 1649, in callHandlers File "logginginit.py", line 950, in handle File "logginginit.py", line 1183, in emit File "logginginit.py", line 1089, in emit Message: 'part-%i written to %s' Arguments: (0, <

io.BufferedWriter name='C:\Users\freya\AppData\Roaming\Anki2\Freya\collection.media\힘내다_N_ko.mp3'>) --- Logging error --- Traceback (most recent call last): File "logging_init.py", line 1084, in emit File "C:\python\lib\encodings\cp1252.py", line 19, in encode UnicodeEncodeError: 'charmap' codec can't encode characters in position 144-146: character maps to Call stack: File "runanki.py", line 4, in File "aqtinit.py", line 405, in run File "aqtinit.py", line 574, in

run File "aqt\webview.py", line 35, in cmd File "aqt\webview.py", line 124, in onCmd File "aqt\webview.py", line 569, in onBridgeCmd File "aqt\editor.py", line 428, in onBridgeCmd File "aqt\hooks_gen.py", line 1503, in call File "anki\hooks.py", line 45, in runFilter File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost if updateFields(note, field, allFields): File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields update_Sound_fields(fieldsCopy[currentField], fieldsCopy) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields s = sound(hangul) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound return "[sound:{}]".format(tts.download(text, "ko", service=source)) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 44, in download tts.save(path) File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 253, in save log.debug("Saved to %s", savefile) File "logging_init.py", line 1422, in debug File "logging_init.py", line 1577, in log File "logging_init.py", line 1587, in handle File "logging_init.py", line 1649, in callHandlers File "logginginit.py", line 950, in handle File "logginginit.py", line 1183, in emit File "logginginit.py", line 1089, in emit Message: 'Saved to %s' Arguments: ('C:\Users\freya\AppData\Roaming\Anki2\Freya\collection.media\힘내다_N_ko.mp3',)`

Everything still works fine, so it's just a bit of an inconvenience to have to close the pop-up every time. I don't seem to get the error 100% of the time but let's say it's at least 90%.

Thank you in advance for looking into this!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scottgigante/korean-support/issues/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACA3DX3DUMMVHQOQ4DZGXGLTG52FHANCNFSM42KS66PA .

scottgigante commented 3 years ago

Hi @FreyaDC , the add-on has been updated and hopefully your problem should be fixed. Could you please try it out and confirm?

FreyaDC commented 3 years ago

Hi @FreyaDC , the add-on has been updated and hopefully your problem should be fixed. Could you please try it out and confirm?

Thank you so much for taking the time to look into this! I updated the add-on but unfortunately the issue doesn't seem to be fixed for me, I'm still getting the same error message.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.43 (0fbae6bc) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-05-21 20:03:34

--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 85-86: character maps to <undefined>
Call stack:
  File "runanki.py", line 4, in <module>
  File "aqt\__init__.py", line 421, in run
  File "aqt\__init__.py", line 596, in _run
  File "aqt\webview.py", line 36, in cmd
  File "aqt\webview.py", line 135, in _onCmd
  File "aqt\webview.py", line 580, in _onBridgeCmd
  File "aqt\editor.py", line 451, in onBridgeCmd
  File "aqt\hooks_gen.py", line 1547, in __call__
  File "anki\hooks.py", line 45, in runFilter
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost
    if updateFields(note, field, allFields):
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields
    update_Sound_fields(fieldsCopy[currentField], fieldsCopy)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields
    s = sound(hangul)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound
    return "[sound:{}]".format(tts.download(text, "ko", service=source))
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 41, in download
    tts = NaverTTS(text, lang=lang, speed=speed, gender=gender)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 114, in __init__
    log.debug(utils._sanitize("%s: %s" % (k, v)))
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: 'text: 재수'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\uff1f' in position 160: character maps to <undefined>
Call stack:
  File "runanki.py", line 4, in <module>
  File "aqt\__init__.py", line 421, in run
  File "aqt\__init__.py", line 596, in _run
  File "aqt\webview.py", line 36, in cmd
  File "aqt\webview.py", line 135, in _onCmd
  File "aqt\webview.py", line 580, in _onBridgeCmd
  File "aqt\editor.py", line 451, in onBridgeCmd
  File "aqt\hooks_gen.py", line 1547, in __call__
  File "anki\hooks.py", line 45, in runFilter
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost
    if updateFields(note, field, allFields):
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields
    update_Sound_fields(fieldsCopy[currentField], fieldsCopy)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields
    s = sound(hangul)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound
    return "[sound:{}]".format(tts.download(text, "ko", service=source))
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 41, in download
    tts = NaverTTS(text, lang=lang, speed=speed, gender=gender)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 114, in __init__
    log.debug(utils._sanitize("%s: %s" % (k, v)))
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: "tokenizer_func: <bound method Tokenizer.run of re.compile('(?<=\\\\?).|(?<=!).|(?<=?).|(?<=!).|(?<!\\\\.[a-z])\\\\. |(?<!\\\\.[a-z]), |(?<!\\\\d):|。|:|،|\\\\)|,|¡|\\\\(|\\\\\\n|¿|…|;|—|‥|\\\\]|、|\\\\[', re.IGNORECASE) from: [<function tone_marks at 0x000001D5DF58FB80>, <function period_comma at 0x000001D5DF58FCA0>, <function colon at 0x000001D5DF58FD30>, <function other_punctuation at 0x000001D5DF58FDC0>]>"
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 194-195: character maps to <undefined>
Call stack:
  File "runanki.py", line 4, in <module>
  File "aqt\__init__.py", line 421, in run
  File "aqt\__init__.py", line 596, in _run
  File "aqt\webview.py", line 36, in cmd
  File "aqt\webview.py", line 135, in _onCmd
  File "aqt\webview.py", line 580, in _onBridgeCmd
  File "aqt\editor.py", line 451, in onBridgeCmd
  File "aqt\hooks_gen.py", line 1547, in __call__
  File "anki\hooks.py", line 45, in runFilter
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost
    if updateFields(note, field, allFields):
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields
    update_Sound_fields(fieldsCopy[currentField], fieldsCopy)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields
    s = sound(hangul)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound
    return "[sound:{}]".format(tts.download(text, "ko", service=source))
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 44, in download
    tts.save(path)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 252, in save
    self.write_to_fp(f)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 232, in write_to_fp
    log.debug(utils._sanitize("part-%i written to %s" % (idx, fp)))
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: "part-0 written to <_io.BufferedWriter name='C:\\\\Users\\\\freya\\\\AppData\\\\Roaming\\\\Anki2\\\\Freya\\\\collection.media\\\\재수_N_ko.mp3'>"
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1084, in emit
  File "C:\python\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 144-145: character maps to <undefined>
Call stack:
  File "runanki.py", line 4, in <module>
  File "aqt\__init__.py", line 421, in run
  File "aqt\__init__.py", line 596, in _run
  File "aqt\webview.py", line 36, in cmd
  File "aqt\webview.py", line 135, in _onCmd
  File "aqt\webview.py", line 580, in _onBridgeCmd
  File "aqt\editor.py", line 451, in onBridgeCmd
  File "aqt\hooks_gen.py", line 1547, in __call__
  File "anki\hooks.py", line 45, in runFilter
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit.py", line 63, in onFocusLost
    if updateFields(note, field, allFields):
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 80, in updateFields
    update_Sound_fields(fieldsCopy[currentField], fieldsCopy)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_behavior.py", line 48, in update_Sound_fields
    s = sound(hangul)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\edit_functions.py", line 171, in sound
    return "[sound:{}]".format(tts.download(text, "ko", service=source))
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\tts.py", line 44, in download
    tts.save(path)
  File "C:\Users\freya\AppData\Roaming\Anki2\addons21\1336389630\lib\navertts\tts.py", line 253, in save
    log.debug(utils._sanitize("Saved to %s" % savefile))
  File "logging\__init__.py", line 1422, in debug
  File "logging\__init__.py", line 1577, in _log
  File "logging\__init__.py", line 1587, in handle
  File "logging\__init__.py", line 1649, in callHandlers
  File "logging\__init__.py", line 950, in handle
  File "logging\__init__.py", line 1183, in emit
  File "logging\__init__.py", line 1089, in emit
Message: 'Saved to C:\\Users\\freya\\AppData\\Roaming\\Anki2\\Freya\\collection.media\\재수_N_ko.mp3'
Arguments: ()
scottgigante commented 3 years ago

Alright, I've uploaded a new release -- hopefully this will solve the problem. Please try again and let me know!

FreyaDC commented 3 years ago

Alright, I've uploaded a new release -- hopefully this will solve the problem. Please try again and let me know!

No luck unfortunately. :( It's the same error still.

scottgigante commented 3 years ago

Could you please post the traceback again? If you have the updated version, it shouldn't be exactly the same (though it may appear so at first glance.)

FreyaDC commented 3 years ago

I think it might have been a mistake on my end somehow. The trace kept giving me the same timestamp for the last update check for the add-ons. So just to be sure I uninstalled the add-on and reinstalled it (as well as the 1 other addon I'm using) and the issue seems to be fixed now!

Thank you again so much for your help and for creating this add-on in the first place, it's saved me so much time.

scottgigante commented 3 years ago

Excellent, I'm glad to hear it! Feel free to let me know if you have any additional issues, and I'm glad you're enjoying the add-on!