[PR #22420] [MERGED] fix: replace bare except with Exception in oauth.py #26677

Closed
opened 2026-04-20 06:38:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22420
Author: @gambletan
Created: 3/8/2026
Status: Merged
Merged: 3/8/2026
Merged by: @tjbck

Base: devHead: fix/bare-except-oauth


📝 Commits (2)

  • cae0603 fix: replace bare except with except Exception in main.py
  • a65d5a2 fix: replace bare except with Exception in oauth.py

📊 Changes

2 files changed (+3 additions, -3 deletions)

View changed files

📝 backend/open_webui/main.py (+2 -2)
📝 backend/open_webui/utils/oauth.py (+1 -1)

📄 Description

Description

  • In oauth.py, a bare except: clause was used which catches all exceptions including SystemExit and KeyboardInterrupt. This prevents clean process shutdown and makes debugging harder.

Fixed

  • Replaced bare except: with except Exception: so that SystemExit, KeyboardInterrupt, and other BaseException subclasses are no longer silently caught.

Additional Information

  • Tested by reviewing the code path and verifying the fix addresses the issue
  • Self-reviewed the code changes

Contributor License Agreement


🔄 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/22420 **Author:** [@gambletan](https://github.com/gambletan) **Created:** 3/8/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/bare-except-oauth` --- ### 📝 Commits (2) - [`cae0603`](https://github.com/open-webui/open-webui/commit/cae0603daceed8f2ca8dbad96bd9a3257453adf9) fix: replace bare except with except Exception in main.py - [`a65d5a2`](https://github.com/open-webui/open-webui/commit/a65d5a2f6a755a285b448045995ac4f0f6fce8ab) fix: replace bare except with Exception in oauth.py ### 📊 Changes **2 files changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/main.py` (+2 -2) 📝 `backend/open_webui/utils/oauth.py` (+1 -1) </details> ### 📄 Description ### Description - In `oauth.py`, a bare `except:` clause was used which catches all exceptions including `SystemExit` and `KeyboardInterrupt`. This prevents clean process shutdown and makes debugging harder. ### Fixed - Replaced bare `except:` with `except Exception:` so that `SystemExit`, `KeyboardInterrupt`, and other `BaseException` subclasses are no longer silently caught. ### Additional Information - Tested by reviewing the code path and verifying the fix addresses the issue - Self-reviewed the code changes ### Contributor License Agreement - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 06:38:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#26677