gregorias / anki-code-highlighter

Anki plugin for code syntax highlighting.
GNU Affero General Public License v3.0
54 stars 3 forks source link

Add-on startup failed #78

Closed mfscifly closed 3 months ago

mfscifly commented 3 months ago

Bug description

On Anki startup, add-on startup fails. Unable to create new cards using add-on features. Attempted add-on update however there are no new updates.

Reproduction steps

Debug info from Anki:

Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3 Platform: macOS-14.1.2-arm64-arm-64bit

When loading Syntax Highlighting for Code: Traceback (most recent call last): File "aqt.addons", line 245, in loadAddons File "/Users//Library/Application Support/Anki2/addons21/1463041493/init.py", line 15, in from . import main File "/Users//Library/Application Support/Anki2/addons21/1463041493/main.py", line 21, in from .consts import * # import addon_path File "/Users/_/Library/Application Support/Anki2/addons21/1463041493/consts.py", line 22, in addon_path = os.path.dirname(file__).decode(sys_encoding) AttributeError: 'str' object has no attribute 'decode'

Expected behavior

No error on startup. Should be able to continue to use code formatting when creating cards.

Screenshots

Screenshot 2024-03-05 at 10 35 36 AM

Card template

If applicable, provide the card template code from the card that exhibits the unwanted behaviour. For instructions how to get that code, see this Anki help page.

Additional information

macOS 14.1.2

Additional context

Other users have reported similar issues. Please see most recent reviews at: https://ankiweb.net/shared/info/1463041493

gregorias commented 3 months ago

Wrong addon. The report is for Syntax Highlighting for Code. My plugin is Highlight Code.

mfscifly commented 3 months ago

Wow, so sorry to bug you. How silly. I must have got them mixed up while trying to figure out what was wrong.

The good news is, using your plugin may solve the problem anyway.

Take care,

Daniel

On Mar 5, 2024, at 10:42 AM, Grzegorz Milka @.***> wrote:

Wrong plugin. The report is for Syntax Highlighting for Code https://ankiweb.net/shared/info/1463041493. My plugin is Highlight Code https://ankiweb.net/shared/info/112228974.

— Reply to this email directly, view it on GitHub https://github.com/gregorias/anki-code-highlighter/issues/78#issuecomment-1979417309, or unsubscribe https://github.com/notifications/unsubscribe-auth/BA6FXFVGFZOBMXNYJOM4JZLYWYGXVAVCNFSM6AAAAABEHVIQIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZZGQYTOMZQHE. You are receiving this because you authored the thread.

gregorias commented 3 months ago

Sure. Let me know if you have any issues.