Skip to content

[Bug] handle tomllib fallback for python 3.10 #226

@stabldev

Description

@stabldev

What happened?

torrra supports python ≥ 3.10, but tomllib is only available in python 3.11+.
on python 3.10, importing tomllib causes a runtime ModuleNotFoundError.

we should use the standard fallback pattern and ensure packaging reflects this.
proposed fix (code):

try:
    import tomllib  # Python 3.11+
except ModuleNotFoundError:
    import tomli as tomllib  # Python 3.10

packaging changes:

  • add conditional dependency for PyPI:
    • tomli; python_version < "3.11"
  • add unconditional dependency in AUR PKGBUILD:
    • python-tomli

this keeps python 3.11+ on stdlib while remaining compatible with python 3.10.

Version

torrra v2.0.4

OS and architecture

Arch Linux x86_64

Terminal Output or Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions