Skip to content

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

Closed

Description

@ondrejj

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

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

Activity

  1. diegorusso commented on Nov 20, 2024

    @diegorusso

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

  2. malthe commented on Nov 20, 2024

    @malthe
    Owner

    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 ...

  3. diegorusso commented on Nov 20, 2024

    @diegorusso

    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!

  4. fschulze commented on Dec 22, 2024

    @fschulze
    Contributor

    The fix for this was merged today.

  5. stevepiercy commented on Mar 24, 2025

    @stevepiercy
    Contributor
  6. fsc-eriker commented on Oct 29, 2025

    @fsc-eriker

    FWIW the very first link is no longer correct; the location for these notes is now https://docs.python.org/dev/whatsnew/3.14.html#id9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions