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

Exception with Cyrillic characters in URL #17

Open
NSBum opened this issue Dec 14, 2019 · 1 comment
Open

Exception with Cyrillic characters in URL #17

NSBum opened this issue Dec 14, 2019 · 1 comment

Comments

@NSBum
Copy link

NSBum commented Dec 14, 2019

Throws an exception when attempting to add URL's containing Russian letters. For example

https://en.wiktionary.org/wiki/выпускаться#Russian

throws this exception:

Error 
An error occurred. Please start Anki...blah blah blah
Debug info:
Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Mac 10.14.6
Flags: frz=True ao=True sv=2
Add-ons possibly involved: Auto Markdown, Frozen Fields
Caught exception:
  File "aqt/webview.py", line 27, in cmd
  File "aqt/webview.py", line 87, in _onCmd
  File "aqt/webview.py", line 368, in _onBridgeCmd
  File "<decorator-gen-58>", line 2, in onBridgeCmd
  File "anki/hooks.py", line 74, in decorator_wrapper
  File "anki/hooks.py", line 71, in repl
  File "/Users/alan/Library/Application Support/Anki2/addons21/516643804/main.py", line 212, in onBridge
    return _old(self, str)
  File "aqt/editor.py", line 273, in onBridgeCmd
  File "anki/hooks.py", line 39, in runFilter
  File "/Users/alan/Library/Application Support/Anki2/addons21/1030875226/editor.py", line 228, in editFocusLostFilter
    isGenerated = fieldIsGeneratedHtml(field_html)
  File "/Users/alan/Library/Application Support/Anki2/addons21/1030875226/editor.py", line 78, in fieldIsGeneratedHtml
    tree = BeautifulSoup(field_html, 'html.parser')
  File "bs4/__init__.py", line 274, in __init__
  File "bs4/__init__.py", line 336, in _check_markup_is_url
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/warnings.py", line 101, in _showwarnmsg
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/warnings.py", line 30, in _showwarnmsg_impl
  File "aqt/errors.py", line 41, in write
<class 'UnicodeEncodeError'>: 'ascii' codec can't encode characters in position 104-113: ordinal not in range(128)
@suvernev-d
Copy link

I'm using Cyrillics a lot, but could not reproduce this (Anki is 2.1.18). Maybe the issue is in Frozen Fields add-on?

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