Here's the log. I couldn't figure out how to fix it. The script still works, but it's annoying to have the error up all the time.
`ServerError
Python 3.8.1: C:\Program Files\WindowsApps\49800KritaProject.Krita_5.1.5.0_x64__n3kgb906j1zjg\krita\bin\krita.exe
Sat Aug 5 21:14:41 2023
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\discord_rpc.py in update_rpc(self=<discord_rpc.discord_rpc.DiscordRpc object>)
31 self.time = time.time()
32 if self.file != Krita.instance().activeDocument().fileName():
33 RPC.update(details="Drawing something cool",
34 state=str(Krita.instance().activeDocument().name()) or "Unnamed",
35 large_image="krita_logo", start=int(self.time))
global RPC = <discord_rpc.presence.Presence object>
RPC.update = <bound method Presence.update of <discord_rpc.presence.Presence object>>
details undefined
state undefined
builtinstr = <class 'str'>
builtinKrita = <PyKrita.krita.Krita object>
Krita.instance =
).activeDocument undefined
large_image undefined
start undefined
builtinint = <class 'int'>
self = <discord_rpc.discord_rpc.DiscordRpc object>
self.time = 1691262773.2325375
C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\presence.py in update(self=<discord_rpc.presence.Presence object>, pid=7364, state='1', details='Drawing something cool', start=1691262773, end=None, large_image='krita_logo', large_text=None, small_image=None, small_text=None, party_id=None, party_size=None, join=None, spectate=None, match=None, buttons=None, instance=True, _donotuse=True)
34 payload = _donotuse
35 self.send_data(1, payload)
36 return self.loop.run_until_complete(self.read_output())
37
38 def clear(self, pid: int = os.getpid()):
self = <discord_rpc.presence.Presence object>
self.loop =
self.loop.run_until_complete = >
self.read_output = <bound method BaseClient.read_output of <discord_rpc.presence.Presence object>>
C:\Users\nebez\AppData\Local\PowerToys\asyncio\base_events.py in run_until_complete(self=, future=<Task finished name='Task-53' coro=<BaseClient.r...ate" length must be at least 2 characters long')>)
C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\baseclient.py in read_output(self=<discord_rpc.presence.Presence object>)
86 payload = json.loads(data.decode('utf-8'))
87 if payload["evt"] == "ERROR":
88 raise ServerError(payload["data"]["message"])
89 return payload
90
global ServerError = <class 'discord_rpc.exceptions.ServerError'>
payload = {'cmd': 'SET_ACTIVITY', 'data': {'code': 4000, 'message': 'child "activity" fails because [child "state" fa...tate" length must be at least 2 characters long]]'}, 'evt': 'ERROR', 'nonce': '1691262881.96334934234619140625'}
ServerError: Child "activity" fails because child "state" fails because "state" length must be at least 2 characters long
cause = None
class = <class 'discord_rpc.exceptions.ServerError'>
context = None
delattr = <method-wrapper 'delattr' of ServerError object>
dict = {}
dir =
doc = None
eq = <method-wrapper 'eq' of ServerError object>
format =
ge = <method-wrapper 'ge' of ServerError object>
getattribute = <method-wrapper 'getattribute' of ServerError object>
gt = <method-wrapper 'gt' of ServerError object>
hash = <method-wrapper 'hash' of ServerError object>
init = <bound method ServerError.init of ServerErro...ate" length must be at least 2 characters long')>
init_subclass =
le = <method-wrapper 'le' of ServerError object>
lt = <method-wrapper 'lt' of ServerError object>
module = 'discord_rpc.exceptions'
ne = <method-wrapper 'ne' of ServerError object>
new =
reduce =
reduce_ex =
repr = <method-wrapper 'repr' of ServerError object>
setattr = <method-wrapper 'setattr' of ServerError object>
setstate =
sizeof =
str = <method-wrapper 'str' of ServerError object>
subclasshook =
suppress_context = False
traceback =
weakref = None
args = ('Child "activity" fails because child "state" fai..."state" length must be at least 2 characters long',)
with_traceback =
The above is a description of an error in a Python program. Here is
the original traceback:
Traceback (most recent call last):
File "C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\discord_rpc.py", line 33, in update_rpc
RPC.update(details="Drawing something cool",
File "C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\presence.py", line 36, in update
return self.loop.run_until_complete(self.read_output())
File "asyncio\base_events.py", line 612, in run_until_complete
File "C:\Users\nebez\AppData\Roaming\krita\pykrita\discord_rpc\baseclient.py", line 88, in read_output
raise ServerError(payload["data"]["message"])
discord_rpc.exceptions.ServerError: Child "activity" fails because child "state" fails because "state" length must be at least 2 characters long
`