Skip to content
This repository was archived by the owner on Jun 25, 2022. It is now read-only.
This repository was archived by the owner on Jun 25, 2022. It is now read-only.

Hotkeys: UnicodeDecodeError #109

@Kirossos

Description

@Kirossos

Hi, I am very new to this API, so I am sorry if I miss something that causes the error :)
Now to the Problem, when I try to implement hotkeys into my plugin, I get an unicodeDecodeError in the client protocol.
I have build a basic plugin, that replicates the error, at least on my machine.

from ts3plugin import ts3plugin

import ts3lib, ts3defines

class testplugin(ts3plugin):
    name = "hotkeytest"
    requestAutoload = False
    version = "1.0"
    apiVersion = 21
    author = "Timo"
    description = "This is a testplugin"
    offersConfigure = True
    commandKeyword = ""
    infoTitle = ""
    menuItems = []#[(ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_CLIENT, 0, "text", "icon.png")]
    hotkeys = [("keyword", "description")]#[("keyword", "description")]

    def __init__(self):
        ts3lib.printMessageToCurrentTab("Yay, we are running!")
        ts3lib.requestHotkeyInputDialog("keyword", True)

    def stop(self):
        ts3lib.printMessageToCurrentTab("Oh no, we were stopped :(")

    def onHotkeyRecordedEvent(self, keyword, key):
        ts3lib.printMessageToCurrentTab("Recorded")

    def onHotkeyEvent(self, keyword):
        ts3lib.printMessageToCurrentTab("YEAHHHHH!!!!!")

The error in the client protocol:

01.12.2018 17:35:20		Info	Memory usage: 167.97 MiB	
01.12.2018 17:35:36	pyTSon	Error	Calling onHotkeyEvent failed with error "Error calling method
Traceback (most recent call last):
  File "C:/Users/Timo/AppData/Roaming/TS3Client/plugins/pyTSon/scripts\pluginhost.py", line 382, in callMethod
    return meth(*args)
  File "C:/Users/Timo/AppData/Roaming/TS3Client/plugins/pyTSon/scripts\pluginhost.py", line 683, in onHotkeyEvent
    cls.showScriptingConsole()
  File "C:/Users/Timo/AppData/Roaming/TS3Client/plugins/pyTSon/scripts\pluginhost.py", line 358, in showScriptingConsole
    txtcolor, w, h, startup, silent)
  File "C:/Users/Timo/AppData/Roaming/TS3Client/plugins/pyTSon/include\pytsonui\console.py", line 89, in __init__
    self.runCommand(f.read(), silentStartup)
  File "C:/Users/Timo/AppData/Roaming/TS3Client/plugins/pyTSon/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 1587: character maps to <undefined>
"

After starting the plugin and binding a key, I get this error whenever I press the bound button.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions