Skip to content

Conversation

@MichaReiser
Copy link
Member

Summary

Fixes astral-sh/ty#354

Exit with a code of 2 if there's any IO error (because ty failed to read a file).

Test Plan

Updated test

@MichaReiser MichaReiser added the cli Related to the command-line interface label Nov 18, 2025
@MichaReiser MichaReiser requested a review from carljm as a code owner November 18, 2025 08:41
@MichaReiser MichaReiser added the ty Multi-file analysis & type inference label Nov 18, 2025
@MichaReiser MichaReiser force-pushed the micha/io-error-exit-code branch from 7fbc1c5 to c8d3c5f Compare November 18, 2025 08:42
@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 18, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@MichaReiser
Copy link
Member Author

MichaReiser commented Nov 18, 2025

Hmm, the mypy primer error is annoying

Pythonwin/pywin/test/_dbgscript.py: error[io] Failed to read file: stream did not contain valid UTF-8

The file is encoded in latin-1 and contains Umlaute
https://github.com/mhammond/pywin32/blob/main/Pythonwin/pywin/test/_dbgscript.py

I believe this is the desired behavior. But we now need a way to exclude this file 😟

@MichaReiser MichaReiser force-pushed the micha/io-error-exit-code branch from 3c8a5c1 to f3298fb Compare November 18, 2025 09:20
@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 18, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 18, 2025

mypy_primer results

No ecosystem changes detected ✅

No memory usage changes detected ✅

@MichaReiser MichaReiser force-pushed the micha/io-error-exit-code branch from f3298fb to e39cfc9 Compare November 18, 2025 17:36
@MichaReiser MichaReiser force-pushed the micha/io-error-exit-code branch from e39cfc9 to 43f165d Compare November 18, 2025 17:42
@sharkdp
Copy link
Contributor

sharkdp commented Nov 18, 2025

Running ecosystem-analyzer, just to make sure that it also picks up the mypy_primer changes.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 18, 2025

ecosystem-analyzer results

Failing projects:

Project Old Status New Status Old Return Code New Return Code
pywin32 success abnormal exit 1 2
dd-trace-py success abnormal exit 1 2

No diagnostic changes detected ✅
Full report with detailed diff (timing results)

@sharkdp
Copy link
Contributor

sharkdp commented Nov 18, 2025

Ok, it does not automatically pick it up. I need to update the lockfile.

@MichaReiser MichaReiser merged commit 663f78e into main Nov 19, 2025
42 checks passed
@MichaReiser MichaReiser deleted the micha/io-error-exit-code branch November 19, 2025 08:39
dcreager added a commit that referenced this pull request Nov 19, 2025
* origin/main:
  [ty] Fix flaky tests on macos (#21524)
  [ty] Add tests for generic implicit type aliases (#21522)
  [ty] Semantic tokens: consistently add the `DEFINITION` modifier (#21521)
  Only render hyperlinks for terminals known to support them (#21519)
  [ty] Keep colorizing `mypy_primer` output (#21515)
  [ty] Exit with `2` if there's any IO error (#21508)
  [`ruff`] Fix false positive for complex conversion specifiers in `logging-eager-conversion` (`RUF065`) (#21464)
  [ty] tighten up handling of subscripts in type expressions (#21503)
dcreager added a commit that referenced this pull request Nov 19, 2025
* origin/main:
  [ty] Fix flaky tests on macos (#21524)
  [ty] Add tests for generic implicit type aliases (#21522)
  [ty] Semantic tokens: consistently add the `DEFINITION` modifier (#21521)
  Only render hyperlinks for terminals known to support them (#21519)
  [ty] Keep colorizing `mypy_primer` output (#21515)
  [ty] Exit with `2` if there's any IO error (#21508)
  [`ruff`] Fix false positive for complex conversion specifiers in `logging-eager-conversion` (`RUF065`) (#21464)
  [ty] tighten up handling of subscripts in type expressions (#21503)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not exit with status code 1 for IO errors

4 participants