Skip to content

fix: replace removed ast.Str with ast.Constant - #390

Merged
JarbasAl merged 1 commit into
devfrom
fix/ast-constant-py314
Aug 25, 2026
Merged

fix: replace removed ast.Str with ast.Constant#390
JarbasAl merged 1 commit into
devfrom
fix/ast-constant-py314

Conversation

@JarbasAl

Copy link
Copy Markdown
Member

🤖 Auto-generated by Claude Opus 5 (claude-opus-5) via Claude Code — NOT human-reviewed. Verify before acting.

Python 3.14 removed ast.Str. Every code path that analyses a skill's Python source hit AttributeError: module 'ast' has no attribute 'Str', so ten tests failed and the suite could not give evidence about anything else.

ast.Constant also carries ints, bytes and None, so the check is on the value rather than the node type. A numeric decorator argument is no longer read as an intent filename.

This blocks Renovate #198, which proposes moving the repo to Python 3.14.

Verification

Run locally in a clean venv on Python 3.14.6 (uv venv + uv pip install -e . pytest):

  • Before: 10 failed, 166 passed — all ten failures were this one AttributeError.
  • After: 171 passed.
  • The two new tests fail on the unfixed code and pass on the fixed code (verified by reverting only the source file and re-running them).

Claims verified against source: the single ast.Str occurrence at ovos_localize/analyzers/ast_analyzer.py:300 (grep for ast.Str|ast.Num|ast.Bytes|ast.NameConstant finds no others). Test counts are from executed runs.

Python 3.14 removed ast.Str, so every code path that analyses a skill's
Python source raised AttributeError. Ten tests failed on 3.14, which left
the suite unable to give evidence about anything else.

ast.Constant also carries ints, bytes and None, so the string check is on
the value rather than the node type -- a numeric decorator argument is no
longer read as an intent filename.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d47253bf-2adb-4e2d-a4b7-732faf81935f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JarbasAl
JarbasAl marked this pull request as ready for review August 25, 2026 20:38
@JarbasAl
JarbasAl merged commit b019d02 into dev Aug 25, 2026
1 check passed
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