Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.14: AttributeError: module 'ast' has no attribute 'Str' #430

Open
Tracked by #42
ondrejj opened this issue Oct 30, 2024 · 4 comments
Open
Tracked by #42

Python 3.14: AttributeError: module 'ast' has no attribute 'Str' #430

ondrejj opened this issue Oct 30, 2024 · 4 comments
Labels

Comments

@ondrejj
Copy link

ondrejj commented Oct 30, 2024

According to: https://docs.python.org/dev/whatsnew/3.14.html#id2

Remove the following classes. They were all deprecated since Python 3.8, and
have emitted deprecation warnings since Python 3.12:
ast.Bytes
ast.Ellipsis
ast.NameConstant
ast.Num
ast.Str

Use ast.Constant instead. As a consequence of these removals, user-defined
visit_Num, visit_Str, visit_Bytes, visit_NameConstant and visit_Ellipsis
methods on custom ast.NodeVisitor subclasses will no longer be called when the
NodeVisitor subclass is visiting an AST. Define a visit_Constant method
instead.

https://bugzilla.redhat.com/show_bug.cgi?id=2322715

@diegorusso
Copy link

I confirm I have encountered this error while running pyperformance with CPython main.

@malthe malthe added the bug label Nov 20, 2024
@malthe
Copy link
Owner

malthe commented Nov 20, 2024

Just noting that the final release for 3.14 is October, 2025: https://peps.python.org/pep-0745/.

But time moves fast, so it would be good to be on top of this soonish ...

@diegorusso
Copy link

Just noting that the final release for 3.14 is October, 2025: https://peps.python.org/pep-0745/.

But time moves fast, so it would be good to be on top of this soonish ...

That's correct. I guess from the user point of view there is time, but from the CPython development point of view this causes some issues. Chameleon is used in pyperformance (https://github.com/python/pyperformance/tree/main/pyperformance/data-files/benchmarks/bm_chameleon) and currently it is failing. main branch is mainly where we track our performances and it would be good to have it working again :)
I'll be monitoring this issue and as soon as there is a new release with the fix, I'll update pyperformance.

Thanks!

@fschulze
Copy link
Contributor

The fix for this was merged today.

credfeto added a commit to credfeto/LiveBandPhotosCom that referenced this issue Jan 1, 2025
Bumps [chameleon](https://github.com/malthe/chameleon) from 4.5.4 to
4.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/malthe/chameleon/releases">chameleon's
releases</a>.</em></p>
<blockquote>
<h2>4.6.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix issue with multiple dollar escape by <a
href="https://github.com/malthe"><code>@​malthe</code></a> in <a
href="https://redirect.github.com/malthe/chameleon/pull/423">malthe/chameleon#423</a></li>
<li>Fix OS runner config by <a
href="https://github.com/malthe"><code>@​malthe</code></a> in <a
href="https://redirect.github.com/malthe/chameleon/pull/425">malthe/chameleon#425</a></li>
<li>Fix load_module deprecation warnings for Python &gt;= 3.10. by <a
href="https://github.com/fschulze"><code>@​fschulze</code></a> in <a
href="https://redirect.github.com/malthe/chameleon/pull/432">malthe/chameleon#432</a></li>
<li>Fix lint tests by explicitly adding Python 3.13 to GitHub and tox.
by <a href="https://github.com/fschulze"><code>@​fschulze</code></a> in
<a
href="https://redirect.github.com/malthe/chameleon/pull/433">malthe/chameleon#433</a></li>
<li>Fix ast deprecation warnings up to Python 3.13. by <a
href="https://github.com/fschulze"><code>@​fschulze</code></a> in <a
href="https://redirect.github.com/malthe/chameleon/pull/434">malthe/chameleon#434</a></li>
<li>Remove unnecessary fixups by <a
href="https://github.com/malthe"><code>@​malthe</code></a> in <a
href="https://redirect.github.com/malthe/chameleon/pull/435">malthe/chameleon#435</a></li>
<li>Calculate package digest on first use. by <a
href="https://github.com/fschulze"><code>@​fschulze</code></a> in <a
href="https://redirect.github.com/malthe/chameleon/pull/436">malthe/chameleon#436</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/malthe/chameleon/compare/4.5.3...4.6.0">https://github.com/malthe/chameleon/compare/4.5.3...4.6.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/malthe/chameleon/blob/master/CHANGES.rst">chameleon's
changelog</a>.</em></p>
<blockquote>
<h2>4.6.0 (2024-12-31)</h2>
<ul>
<li>
<p>Improve startup time when no template is used.</p>
</li>
<li>
<p>Fix <code>ast</code> deprecation warnings up to Python 3.13.
(<code>[#430](malthe/chameleon#430)
&lt;https://github.com/malthe/chameleon/issues/430&gt;</code>_)</p>
</li>
<li>
<p>Fix <code>load_module</code> deprecation warnings for Python &gt;=
3.10.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/malthe/chameleon/commit/790e31c4fe0529cbf437dd96e448cbeca1fb6738"><code>790e31c</code></a>
Tagging release</li>
<li><a
href="https://github.com/malthe/chameleon/commit/90c1653fe43c2464967af345a8ae52c26dd12bc4"><code>90c1653</code></a>
Merge pull request <a
href="https://redirect.github.com/malthe/chameleon/issues/436">#436</a>
from fschulze/pkgdigest</li>
<li><a
href="https://github.com/malthe/chameleon/commit/f87613ad2b09d29927d21bcf6df2e8feb1303f02"><code>f87613a</code></a>
Add change entry</li>
<li><a
href="https://github.com/malthe/chameleon/commit/44495c84bfe839e52c185dd52acb03f6fe7e83c9"><code>44495c8</code></a>
Calculate package digest on first use.</li>
<li><a
href="https://github.com/malthe/chameleon/commit/e194d1018420ec4b3a7e78d39663b27dff5edab4"><code>e194d10</code></a>
Merge pull request <a
href="https://redirect.github.com/malthe/chameleon/issues/435">#435</a>
from malthe/fix-lineno</li>
<li><a
href="https://github.com/malthe/chameleon/commit/c6ec5aa899092bfa04d90fffd0a3e3f1cdc1950b"><code>c6ec5aa</code></a>
Remove unnecessary fixups</li>
<li><a
href="https://github.com/malthe/chameleon/commit/2b14af4ee5ac1ad411939f468a1e9a0ee6e54fe9"><code>2b14af4</code></a>
Merge pull request <a
href="https://redirect.github.com/malthe/chameleon/issues/434">#434</a>
from fschulze/ast-deprecations</li>
<li><a
href="https://github.com/malthe/chameleon/commit/b44fac42b1c9c0d947407ba4f673fbcec82136ba"><code>b44fac4</code></a>
Fix ast deprecation warnings up to Python 3.13.</li>
<li><a
href="https://github.com/malthe/chameleon/commit/1aae55f1204a5a794f7fc6bfa1c96dbb91a1bd98"><code>1aae55f</code></a>
Merge pull request <a
href="https://redirect.github.com/malthe/chameleon/issues/433">#433</a>
from fschulze/lint-fixes</li>
<li><a
href="https://github.com/malthe/chameleon/commit/743e5010283a958396e0a5886aa22f5c33c6d875"><code>743e501</code></a>
Fix lint tests by explicitly adding Python 3.13 to GitHub and tox.</li>
<li>Additional commits viewable in <a
href="https://github.com/malthe/chameleon/compare/4.5.4...4.6.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=chameleon&package-manager=pip&previous-version=4.5.4&new-version=4.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants