Explorar el Código

Fix crash on an empty response

This check was a leftover from the resumeKey pagination, where empty responses are supposed to be impossible. With the page pagination, they are possible.
master
JustAnotherArchivist hace 2 años
padre
commit
5bc3d4b020
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. +3
    -1
      ia-cdx-search

+ 3
- 1
ia-cdx-search Ver fichero

@@ -51,7 +51,9 @@ async def wait_first_and_print(tasks):
return
task = tasks.popleft()
url, code, o, connection = await task
assert o, 'got empty response'
if not o:
print(f'Completed processing page {task._ia_cdx_page} (0 results)', file = sys.stderr)
return task._ia_cdx_page, connection
fields = o[0]
assert all(len(v) == len(fields) for v in o[1:]), 'got unexpected response format'
for row in o[1:]:


Cargando…
Cancelar
Guardar