Skip to content

Conversation

@przadka
Copy link
Collaborator

@przadka przadka commented Nov 24, 2025

⚠️ DO NOT MERGE - This is a test PR

This PR intentionally reverts the buffer overflow fix to verify that our CI setup properly catches the bug on Python 3.14.

Expected result: The regular integration tests (with pytest-xdist) should FAIL on Python 3.14 when running test_help_with_tty.

If it fails as expected, we know our simplified CI setup works correctly and we can close this PR.

…upport

This commit addresses issue Backblaze#1119 where B2 CLI crashes with SystemError
on Python 3.14+ due to a buffer overflow bug in the rst2ansi dependency.

Changes:
- Add try-except handler in arg_parser.py to catch SystemError from rst2ansi
- Fall back to plain text formatting when rst2ansi fails
- Add integration test to verify the fix works with real PTY on Python 3.14
- Add dedicated nox session (integration_pty) for PTY tests without xdist
- Add Python 3.14 to noxfile.py, CI matrix, and pyproject.toml

The root cause is in rst2ansi's get_terminal_size() which passes a 4-byte
buffer to TIOCGWINSZ ioctl instead of the required 8 bytes. Python 3.14
enforces stricter buffer validation, triggering the error.

Fixes Backblaze#1119
The PTY test doesn't work properly with pytest-xdist parallelization.
Instead of a dedicated nox session, run it directly in CI on Python 3.14
without xdist to properly test the buffer overflow fix.
This is a test commit to validate that our CI setup properly detects
the buffer overflow bug. This should FAIL on Python 3.14 PTY test.

DO NOT MERGE - This is intentionally broken to test CI.
@przadka przadka marked this pull request as ready for review November 24, 2025 10:27
@przadka
Copy link
Collaborator Author

przadka commented Nov 24, 2025

✅ Validation successful!

The regular integration tests correctly catch the buffer overflow bug on Python 3.14. The test fails as expected when the fix is not present, confirming our CI setup works properly.

No need for a separate PTY test step - the standard integration tests with pytest-xdist are sufficient.

@przadka przadka closed this Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants