Skip to content

Commit

Permalink
catch OSError from getpass.getuser
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Oct 24, 2024
1 parent 5661b96 commit e6b4cce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Unreleased
- Logging works with client addresses containing an IPv6 scope :issue:`2952`
- Ignore invalid authorization parameters. :issue:`2955`
- Improve type annotation fore ``SharedDataMiddleware``. :issue:`2958`
- Compatibility with Python 3.13 when generating debugger pin and the current
UID does not have an associated name. :issue:`2957`


Version 3.0.4
Expand Down
3 changes: 2 additions & 1 deletion src/werkzeug/debug/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ def get_pin_and_cookie_name(
# App Engine. It may also raise a KeyError if the UID does not
# have a username, such as in Docker.
username = getpass.getuser()
except (ImportError, KeyError):
# Python >= 3.13 only raises OSError
except (ImportError, KeyError, OSError):
username = None

mod = sys.modules.get(modname)
Expand Down

0 comments on commit e6b4cce

Please sign in to comment.