HelloZeroNet / HelloZeroNet/ZeroNet

Unhandled exception: FileNotFoundError

Abierto
#2,494 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
18.8k
Forks
2.3k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

* ZeroNet version: rev 4471
* Operating system: Linux

When I open a site, where I have logged in with my ID, but haven't posted any messages yet, the following exception occurs:

```
[11:32:23] - Unhandled exception: FileNotFoundError: [Errno 2] No such file or directory: './data/1Vp5LH4wegCaqeB72yMw2jgNdVm4aR7ET/data/users/1GooUE19488nDwG3TdkM8seYAHct4gjkq4/content.json' in gevent/threadpool.py line 137 > SiteStorage.py line 372 > 258
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/gevent/threadpool.py", line 137, in __run_task
thread_result.set(func(*args, **kwargs))
File "/root/src/Site/SiteStorage.py", line 372, in loadJson
with self.open(inner_path, "r", encoding="utf8") as file:
File "/root/src/Site/SiteStorage.py", line 258, in open
return open(file_path, mode, **kwargs)
FileNotFoundError: [Errno 2] No such file or directory: './data/1Vp5LH4wegCaqeB72yMw2jgNdVm4aR7ET/data/users/1GooUE19488nDwG3TdkM8seYAHct4gjkq4/content.json'
```

Doesn't seem to have any negative impact on the functioning of the site or ZeroNet. However I guess the missing file condition can be handled in more graceful way.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start in Site/SiteStorage.py at loadJson around line 372 and follow its call to open around line 258. Reproduce the issue by opening a site for a logged-in ID that has not posted messages, then inspect how the missing content.json is handled. Done means this condition no longer produces an unhandled exception while the site continues functioning.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
backend
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
50/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.