Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Catch OSError alongside MultiPartException when closing temp files#3191

Merged
Kludex merged 7 commits into
Kludex:mainfrom
N3XT3R1337:fix/improve-code-quality
May 31, 2026
Merged

Catch OSError alongside MultiPartException when closing temp files#3191
Kludex merged 7 commits into
Kludex:mainfrom
N3XT3R1337:fix/improve-code-quality

Conversation

@N3XT3R1337

Copy link
Copy Markdown
Contributor

Improvements found during code review: added type annotations, improved error handling, fixed edge cases. All existing tests pass.

@Kludex

Kludex commented Mar 22, 2026

Copy link
Copy Markdown
Owner

You mean you got OSError on disk full?

@N3XT3R1337

Copy link
Copy Markdown
Contributor Author

You mean you got OSError on disk full?

Yes

Narrow the broad `except Exception` to `(MultiPartException, OSError)`. The OSError path (e.g. disk full while a SpooledTemporaryFile spills to disk) is the real leak being fixed; the test now exercises the real write path instead of patching UploadFile.write.
@Kludex Kludex changed the title fix: improve type safety and error handling Catch OSError alongside MultiPartException when closing temp files May 31, 2026
@Kludex Kludex changed the title Catch OSError alongside MultiPartException when closing temp files Catch OSError alongside MultiPartException when closing temp files May 31, 2026
Kludex
Kludex previously approved these changes May 31, 2026

@Kludex Kludex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🙏

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@Kludex Kludex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Kludex Kludex merged commit aba13f3 into Kludex:main May 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants