[PR #130] [MERGED] feat(api): handle exceptions for function getpass.getuser() #169

Closed
opened 2026-05-05 03:27:07 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/XuehaiPan/nvitop/pull/130
Author: @XuehaiPan
Created: 7/12/2024
Status: Merged
Merged: 7/12/2024
Merged by: @XuehaiPan

Base: mainHead: getuser


📝 Commits (3)

  • ebca048 feat(api): handle exceptions for function getpass.getuser()
  • a541413 chore(pre-commit): update pre-commit hooks
  • 511757a docs(CHANGELOG): update CHANGELOG.md

📊 Changes

6 files changed (+43 additions, -25 deletions)

View changed files

📝 .pre-commit-config.yaml (+1 -1)
📝 CHANGELOG.md (+1 -1)
📝 docs/source/spelling_wordlist.txt (+1 -0)
📝 nvitop/api/host.py (+21 -1)
📝 nvitop/gui/library/utils.py (+13 -16)
📝 nvitop/select.py (+6 -6)

📄 Description

Issue Type

  • Improvement/feature implementation

Description

Move the getuser() function under a contextlib.suppress(ImportError, OSError) context.

Motivation and Context

Resolves #129

cc @landgraf @quarckster

This would also resolve an incoming change of the exception type in the Python upstream in Python 3.13.


🔄 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/XuehaiPan/nvitop/pull/130 **Author:** [@XuehaiPan](https://github.com/XuehaiPan) **Created:** 7/12/2024 **Status:** ✅ Merged **Merged:** 7/12/2024 **Merged by:** [@XuehaiPan](https://github.com/XuehaiPan) **Base:** `main` ← **Head:** `getuser` --- ### 📝 Commits (3) - [`ebca048`](https://github.com/XuehaiPan/nvitop/commit/ebca048202cebe6a02746d8bea06340e62837176) feat(api): handle exceptions for function `getpass.getuser()` - [`a541413`](https://github.com/XuehaiPan/nvitop/commit/a5414136a1cf1e3b5e0ccf28f7c01b904d6479b6) chore(pre-commit): update pre-commit hooks - [`511757a`](https://github.com/XuehaiPan/nvitop/commit/511757a44a47c58ccb024aed6fc78a85e41e2832) docs(CHANGELOG): update CHANGELOG.md ### 📊 Changes **6 files changed** (+43 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `.pre-commit-config.yaml` (+1 -1) 📝 `CHANGELOG.md` (+1 -1) 📝 `docs/source/spelling_wordlist.txt` (+1 -0) 📝 `nvitop/api/host.py` (+21 -1) 📝 `nvitop/gui/library/utils.py` (+13 -16) 📝 `nvitop/select.py` (+6 -6) </details> ### 📄 Description <!-- Provide a descriptive summary of the changes in the title above --> #### Issue Type <!-- Pick relevant types and delete the rest --> - Improvement/feature implementation #### Description <!-- Describe the changes in detail --> Move the `getuser()` function under a `contextlib.suppress(ImportError, OSError)` context. #### Motivation and Context <!-- Why are these changes required? --> <!-- What problems do these changes solve? --> <!-- Link to relevant issues --> Resolves #129 - #129 cc @landgraf @quarckster This would also resolve an incoming change of the exception type in the Python upstream in Python 3.13. - python/cpython#29739 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 03:27:07 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/nvitop#169
No description provided.