mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-11 00:04:08 -05:00
[PR #5649] [MERGED] fix: close temporary file after creating it #8523
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/5649
Author: @EtiennePerot
Created: 9/24/2024
Status: ✅ Merged
Merged: 9/24/2024
Merged by: @tjbck
Base:
dev← Head:temp-file-close📝 Commits (1)
fdd27aafix: close temporary file after creating it.📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
backend/open_webui/apps/webui/utils.py(+2 -1)📄 Description
This fixes "The process cannot access the file because it is being used by another process" errors on Windows.
The file is still automatically deleted by the
os.unlinkcall later in the function.Updates #5606
Fixes #5642
Pull Request Checklist
Before submitting, make sure you've checked the following:
devos.unlink(temp_file.name)before callingtemp_file.close()causes this error, and that callingtemp_file.close()beforeos.unlink(temp_file.name)does not.fixChangelog Entry
Fixed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.