Skip to content

term_width() throws Exception on fresh installs #6230

@methical

Description

@methical

Problem

Fresh installing the latest version of beets using pipx results in beets not beeing usable.

11:33:59 chris@fedora ~ → pipx install beets
  installed package beets 2.5.1, installed using Python 3.14.2
  These apps are now globally available
    - beet
done! ✨ 🌟 ✨
11:34:11 chris@fedora ~ → beet config -e
Traceback (most recent call last):
  File "/home/chris/.local/bin/beet", line 5, in <module>
    from beets.ui import main
  File "/home/chris/.local/share/pipx/venvs/beets/lib64/python3.14/site-packages/beets/ui/__init__.py", line 858, in <module>
    indent_str, left, right, separator=" -> ", max_width=term_width()
                                                         ~~~~~~~~~~^^
  File "/home/chris/.local/share/pipx/venvs/beets/lib64/python3.14/site-packages/beets/ui/__init__.py", line 715, in term_width
    buf = fcntl.ioctl(0, termios.TIOCGWINSZ, " " * 4)
SystemError: buffer overflow

Setup

  • OS: Fedora Linux 43 (Workstation Edition) x86_64 (Linux 6.17.12-300.fc43.x86_64)
  • Python version: 3.14.2
  • beets version: 2.5.1
  • Turning off plugins made problem go away (yes/no): dnt

My configuration (output of beet config) is non existent

Running beet to create a config file beet config -e results in the above mentioned error

Bugfix

Editing init.py and catching the correct exception (in my case SystemError) in the method term_width() solves the problem and beets lets me edit a fresh config file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions