UnboundLocalError: local variable 'sessions_temp' referenced before assignment #2

Tancada
oberta 2022-08-19 08:49:49 +02:00 per spla · 1 comment
Owner

The code throws this error after demanding "sessions" to the bot:

Traceback (most recent call last):
File "xmpp.py", line 104, in
sessions = ejabberd.user_sessions_info(mention.acct, bot.mastodon_hostname)
File "/home/mastodon/bots/xmppbot/ejabberdapi.py", line 213, in user_sessions_info
sessions = self.__json_allow_dict_attrs(sessions_temp)
UnboundLocalError: local variable 'sessions_temp' referenced before assignment

The code throws this error after demanding "sessions" to the bot: Traceback (most recent call last): File "xmpp.py", line 104, in <module> sessions = ejabberd.user_sessions_info(mention.acct, bot.mastodon_hostname) File "/home/mastodon/bots/xmppbot/ejabberdapi.py", line 213, in user_sessions_info sessions = self.__json_allow_dict_attrs(sessions_temp) UnboundLocalError: local variable 'sessions_temp' referenced before assignment
spla ha afegit l'etiqueta
bug
2022-08-19 08:50:08 +02:00
Author
Owner

If there is not any active session, the response of the Ejabberd API is []:

(Pdb) response.json()
[]

so sessions_temp is not referenced.

If there is not any active session, the response of the Ejabberd API is []: (Pdb) response.json() [] so sessions_temp is not referenced.
spla ha referenciat aquesta incidència en un commit 2022-08-19 09:25:07 +02:00
spla ha tancat aquesta incidència 2022-08-19 09:25:07 +02:00
Inicia sessió per a unir-te a aquesta conversa.
Sense Milestone
Ningún proyecto
Sense assignats
1 participant
Notificacions
Data de venciment
La fecha de vencimiento es inválida o está fuera de rango. Por favor utilice el formato 'aaaa-mm-dd'.

Sin fecha de vencimiento.

Dependències

Aquesta incidència no té cap dependència.

Referència: spla/xmppbot.py#2
Aún no existe contenido.