Skip to content

ValueError: invalid width 0 (must be > 0) due to TERMWIDTH being 0 #172

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Mickey (@mickey)

This issue only exists if you're running alembic from the commandline in a pseudo-terminal, such as Emacs's shell.

File util.py line 23 calls fcntl.ioctl which unpacks the number 0 into TERMWIDTH, but that is invalid according to the textwrap module, resulting in the aforementioned exception.

The fix is to assign None to TERMWIDTH (if 0) or replace the if check on line 182.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions