Comment 4 for bug 2033388

Revision history for this message
Todd Fisher (taf2) wrote :

I tried out your patch and i think there is one issue which is easy to fix in the legacy Click case:

    @cli.resultcallback()

Should become:

    @cli.result_callback()

Otherwise this got the base command to run but any of the sub commands all fail with:

  File "/usr/bin/pio", line 33, in <module>
    sys.exit(load_entry_point('platformio==4.3.4', 'console_scripts', 'pio')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/platformio/__main__.py", line 129, in main
    maintenance.on_platformio_exception(e)
  File "/usr/lib/python3/dist-packages/platformio/maintenance.py", line 65, in on_platformio_exception
    telemetry.on_exception(e)
  File "/usr/lib/python3/dist-packages/platformio/telemetry.py", line 309, in on_exception
    send_exception(description, is_fatal)
  File "/usr/lib/python3/dist-packages/platformio/telemetry.py", line 381, in send_exception
    mp = MeasurementProtocol()
         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/platformio/telemetry.py", line 77, in __init__
    self["sr"] = "%dx%d" % click.get_terminal_size()
                           ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'click' has no attribute 'get_terminal_size'