Before submitting, make sure you've checked the following:
Target branch:dev
Description: See above.
Changelog: See below.
Documentation: No documentation to update.
Dependencies:: No new dependencies.
Testing:: Manually verified in a Windows VM that calling os.unlink(temp_file.name) before calling temp_file.close() causes this error, and that calling temp_file.close() before os.unlink(temp_file.name) does not.
Code review:: OK.
Prefix:fix
Changelog Entry
Fixed
Fix "The process cannot access the file because it is being used by another process" issue when adding functions/tools on Windows.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/5649
**Author:** [@EtiennePerot](https://github.com/EtiennePerot)
**Created:** 9/24/2024
**Status:** ✅ Merged
**Merged:** 9/24/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `temp-file-close`
---
### 📝 Commits (1)
- [`fdd27aa`](https://github.com/open-webui/open-webui/commit/fdd27aa3213f7fa4b4cbc3455a7a520a92d254b3) fix: close temporary file after creating it.
### 📊 Changes
**1 file changed** (+2 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/apps/webui/utils.py` (+2 -1)
</details>
### 📄 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.unlink` call later in the function.
Updates #5606
Fixes #5642
# Pull Request Checklist
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** `dev`
- [x] **Description:** See above.
- [x] **Changelog:** See below.
- [x] **Documentation:** No documentation to update.
- [x] **Dependencies:**: No new dependencies.
- [x] **Testing:**: Manually verified in a Windows VM that calling `os.unlink(temp_file.name)` before calling `temp_file.close()` causes this error, and that calling `temp_file.close()` before `os.unlink(temp_file.name)` does not.
- [x] **Code review:**: OK.
- [x] **Prefix:** `fix`
# Changelog Entry
### Fixed
- Fix "The process cannot access the file because it is being used by another process" issue when adding functions/tools on Windows.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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.