Skip to content

Comments

Fix double write when refusing hidden files in contents handler#1585

Merged
minrk merged 4 commits intojupyter-server:mainfrom
Krish-876:fix-hidden-file-double-write
Feb 13, 2026
Merged

Fix double write when refusing hidden files in contents handler#1585
minrk merged 4 commits intojupyter-server:mainfrom
Krish-876:fix-hidden-file-double-write

Conversation

@Krish-876
Copy link
Contributor

Fix double write when refusing hidden files in contents handler

When a request targets a hidden file or directory and allow_hidden is false,
the contents handler finishes a 404 response but continues execution and later
attempts to write again. This results in a secondary
RuntimeError: Cannot write() after finish().

This change adds an early return after finishing the error response, preventing
further processing and avoiding the double write, without changing behavior.

Fixes #1563

@krassowski krassowski added the bug label Dec 23, 2025
@minrk minrk enabled auto-merge (squash) February 13, 2026 22:13
@minrk minrk merged commit 33f5e29 into jupyter-server:main Feb 13, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception when trying serve hidden file or directory

3 participants