HKUDS/DeepTutor · error · HTTPException
{filename} is empty.
Error message
{filename} is empty. What it means
Error "{filename} is empty." thrown in HKUDS/DeepTutor.
Source
Thrown at deeptutor/api/routers/reading.py:202
tmp_dir = Path(tempfile.mkdtemp(prefix="dt-reading-"))
tmp_path = tmp_dir / Path(filename).name
written = 0
try:
with tmp_path.open("wb") as sink:
while chunk := await file.read(_UPLOAD_CHUNK):
written += len(chunk)
if written > MAX_MATERIAL_BYTES:
raise HTTPException(
status_code=413,
detail=(
f"{filename} exceeds the "
f"{MAX_MATERIAL_BYTES // (1024 * 1024)} MB limit."
),
)
sink.write(chunk)
if written == 0:
raise HTTPException(status_code=400, detail=f"{filename} is empty.")
store = _store()
manifest = store.ingest(tmp_path, filename=filename)
return _detail(store, manifest)
except HTTPException:
raise
except Exception as exc:
raise _http_error(exc) from exc
finally:
shutil.rmtree(tmp_dir, ignore_errors=True)
@router.get("/materials/{material_id}", response_model=MaterialDetail)
async def get_material(material_id: str) -> MaterialDetail:
store = _store()
try:
return _detail(store, store.manifest(material_id))
except Exception as exc:View on GitHub (pinned to 3e82f13042)
When it happens
Trigger: Thrown at deeptutor/api/routers/reading.py:202 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27).
Data as JSON: /api/errors/7a7ccbcec82bebc6.
Report an issue: GitHub.