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

Crash on negative (unavailable?) terminal width #901

Closed
ark3 opened this Issue Jan 22, 2019 · 0 comments

Comments

1 participant
@ark3
Copy link
Contributor

ark3 commented Jan 22, 2019

Reported traceback is:

Traceback (most recent call last):
  File "/usr/bin/telepresence/telepresence/cli.py", line 131, in crash_reporting
    yield
  File "/usr/bin/telepresence/telepresence/main.py", line 49, in main
    runner.kubectl = KubeInfo(runner, args)
  File "/usr/bin/telepresence/telepresence/startup.py", line 168, in __init__
    self._check_versions(runner)
  File "/usr/bin/telepresence/telepresence/startup.py", line 235, in _check_versions
    runner.show(warning_message)
  File "/usr/bin/telepresence/telepresence/runner/runner.py", line 164, in show
    print(self.wrapper.fill(line), file=sys.stderr)
  File "/opt/circleci/.pyenv/versions/3.5.2/lib/python3.5/textwrap.py", line 364, in fill
    return "\n".join(self.wrap(text))
  File "/opt/circleci/.pyenv/versions/3.5.2/lib/python3.5/textwrap.py", line 355, in wrap
    return self._wrap_chunks(chunks)
  File "/opt/circleci/.pyenv/versions/3.5.2/lib/python3.5/textwrap.py", line 249, in _wrap_chunks
    raise ValueError("invalid width %r (must be > 0)" % self.width)
ValueError: invalid width -1 (must be > 0)

I'm not sure how to reproduce this, but fixing it is straightforward. Essentially, if term_width is less than some reasonable minimum (20?), then just set it to 99999 so that we don't try to word wrap.

@ark3 ark3 added this to To do in Tel Tracker via automation Jan 22, 2019

@ark3 ark3 closed this in 11955ae Jan 24, 2019

Tel Tracker automation moved this from To do to Done Jan 24, 2019

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