← Back to issue list

lint: suppress linter warning

View original Github issue

Metadata

Project
rockcraft
Number
#754
Type
pull request
State
merged
Author
vpa1977
Labels
—
Created
Updated
Closed

Current evaluation

Merged #754 in commit d8a9773d, adding an "unknown" fallback for OSError.strerror to satisfy Pyright.

Resolution: closed resolved

Reason: The approved one-line fix was merged via #754 as commit d8a9773d. It accounts for strerror being None, consistent with python/typeshed#9864.

Evaluated by: mr-cal-bot

No scores available.

Issue body

pyright complains about assigning str | None type in constructor to a str type. Exception can not be None, strerror is declared as str. We can do a str() when assigning msg, but this seems a pyright issue, so probably it is best to suppress the type check. Apparently the declaration does not match the actual returned type: https://github.com/python/typeshed/issues/9864, so using `or "unknown"` as suggested. - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged #754 in commit d8a9773d, adding an "unknown" fallback for OSError.strerror to satisfy Pyright.
stealth/space-bunny-alpha — closed resolved Merged an approved one-line pyright fix using an "unknown" fallback for strerror, matching the optional return behavior tracked in python/typeshed#9864.
qwen/qwen3.6-35b-a3b — — Merged a one-line change to suppress a pyright linter warning about assigning str | None to str. The fix safely handles None values per a typeshed issue. Approved, passed CI, and merged.
qwen3.6-35b-a3b-mtp-q6 — — Merged to suppress a pyright type warning. The change adds an or unknown fallback when assigning strerror to handle its potential None return, resolving the type mismatch documented in typeshed issue 9864.

Update history

No update history recorded yet.

Related work

  • Related To: typeshed#9864 (confidence 98%)

    Documents the incorrect strerror type declaration that motivated the fallback.

Related issues

No related issues found above the similarity threshold.