Skip to content

Python 3.12 compatibility fixes for shell history parsing and history filtering - #1610

Open
olucasfracaro wants to merge 5 commits into
nvbn:masterfrom
olucasfracaro:python312-support
Open

Python 3.12 compatibility fixes for shell history parsing and history filtering#1610
olucasfracaro wants to merge 5 commits into
nvbn:masterfrom
olucasfracaro:python312-support

Conversation

@olucasfracaro

Copy link
Copy Markdown

This PR fixes the remaining Python 3.12 issues I found while running the test suite locally.

What was fixed

  • Fish/Tcsh history parsing

    • Updated get_history() in fish.py and tcsh.py to read history via io.open(...).readlines(), matching current test fixtures and avoiding empty history results in tests.
    • Kept safe error handling for missing/unreadable history files.
  • History filtering in utils.py

    • Adjusted get_valid_history_without_current() filtering to:
      • keep valid Unicode history entries (e.g. café ô)
      • still exclude invalid commands (e.g. nocommand x)
      • continue excluding current command and alias-invocation lines as expected

Validation

Ran locally on Python 3.12.3:

  • pytest tests/shells -q
  • full suite: 1887 passed, 62 skipped

Related

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.

1 participant