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

Vroom fails in non-ANSI terminals with errors about missing color constants #112

Closed
dbarnett opened this issue Jan 21, 2020 · 0 comments · Fixed by #113
Closed

Vroom fails in non-ANSI terminals with errors about missing color constants #112

dbarnett opened this issue Jan 21, 2020 · 0 comments · Fixed by #113
Assignees
Labels

Comments

@dbarnett
Copy link
Contributor

If I try to run vroom or its tests in a limited terminal that doesn't support ANSI color codes such as shelling out from gvim, it fails hard with errors about missing color constants:

:!vroom
Traceback (most recent call last):
  File "/home/dbarnett/.virtualenvs/py37/bin/vroom", line 5, in <module>
    import vroom.__main__
  File "/home/dbarnett/.virtualenvs/py37/lib/python3.7/site-packages/vroom/__main__.py", line 9, in <module>
    import vroom.output
  File "/home/dbarnett/.virtualenvs/py37/lib/python3.7/site-packages/vroom/output.py", line 27, in <module>
    STATUS.PASS: vroom.color.GREEN,
AttributeError: module 'vroom.color' has no attribute 'GREEN'

shell returned 1

The problem is that color.py silently falls back to COLORED=False mode if it can't invoke tput to configure those constants, but other parts of the code assume unconditionally that those constants will be defined.

@dbarnett dbarnett added the bug label Jan 21, 2020
dbarnett added a commit that referenced this issue Jan 21, 2020
Resolves the issue that color constants were conditionally defined but
unconditionally referenced, causing AttributeErrors on any invocation
that falls back to COLORED=False. Defines constants with no-op color
code values so they can still be referenced without cluttering up all
the referencing code with conditionals.

Fixes #112.
@dbarnett dbarnett self-assigned this Jan 21, 2020
dbarnett added a commit that referenced this issue Jan 21, 2020
Resolves the issue that color constants were conditionally defined but
unconditionally referenced, causing AttributeErrors on any invocation
that falls back to COLORED=False. Defines constants with no-op color
code values so they can still be referenced without cluttering up all
the referencing code with conditionals.

Fixes #112.
dbarnett added a commit that referenced this issue Jan 21, 2020
Changes since 0.13.0:
  * Fix compatibility issues with python 3.7 (#110)
  * Fix vroom failing with AttributeErrors when running on non-ANSI
    terminals (#112)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant