rndusr / stig

TUI and CLI for the BitTorrent client Transmission
GNU General Public License v3.0
554 stars 24 forks source link

Exception in callback on terminal pipe #150

Closed tribeiros closed 4 years ago

tribeiros commented 4 years ago

MacOS 10.14.5 Python 3.8.0 stig ersion 0.10.1a

When i execute stig list | grep whatever

Exception in callback _CommandBase.__init__.<locals>.<lambda>(<Task finishe...th exceeded')>) at /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py:236
handle: <Handle _CommandBase.__init__.<locals>.<lambda>(<Task finishe...th exceeded')>) at /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py:236>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 236, in <lambda>
    self._task.add_done_callback(lambda task: self._catch_exceptions(task.result))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 246, in _catch_exceptions
    self._finish(exception=e)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 260, in _finish
    raise exception
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 244, in _catch_exceptions
    callabee(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/base/torrent.py", line 75, in run
    await self.make_torrent_list(tfilter, sort, columns)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/cli/torrent.py", line 49, in make_torrent_list
    print_table(torrents, columns, TORRENT_COLUMNS)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/cli/_table.py", line 251, in print_table
    for row in _assemble_row(table, line_index, pretty=pretty_output):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/cli/_table.py", line 54, in _assemble_row
    row.append((str(cell.get_raw_value()),))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/views/__init__.py", line 96, in get_raw_value
    return repr(value)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/client/ttypes.py", line 243, in __repr__
    return '<%s %s / %s>' % (type(self).__name__, super().__str__(), self.__str__())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/client/ttypes.py", line 243, in __repr__
    return '<%s %s / %s>' % (type(self).__name__, super().__str__(), self.__str__())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/client/ttypes.py", line 243, in __repr__
    return '<%s %s / %s>' % (type(self).__name__, super().__str__(), self.__str__())
  [Previous line repeated 487 more times]
RecursionError: maximum recursion depth exceeded
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/stig", line 8, in <module>
    sys.exit(run())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/__init__.py", line 24, in run
    main.run()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/main.py", line 180, in run
    if not run_commands():
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/main.py", line 157, in run_commands
    success = cmdmgr.run_sync(clicmds)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 519, in run_sync
    process.wait_sync()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 276, in wait_sync
    self._catch_exceptions(self.loop.run_until_complete, self._task)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 246, in _catch_exceptions
    self._finish(exception=e)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 260, in _finish
    raise exception
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 244, in _catch_exceptions
    callabee(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 236, in <lambda>
    self._task.add_done_callback(lambda task: self._catch_exceptions(task.result))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 246, in _catch_exceptions
    self._finish(exception=e)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 260, in _finish
    raise exception
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/__init__.py", line 244, in _catch_exceptions
    callabee(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/base/torrent.py", line 75, in run
    await self.make_torrent_list(tfilter, sort, columns)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/cli/torrent.py", line 49, in make_torrent_list
    print_table(torrents, columns, TORRENT_COLUMNS)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/cli/_table.py", line 251, in print_table
    for row in _assemble_row(table, line_index, pretty=pretty_output):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/commands/cli/_table.py", line 54, in _assemble_row
    row.append((str(cell.get_raw_value()),))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/views/__init__.py", line 96, in get_raw_value
    return repr(value)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/client/ttypes.py", line 243, in __repr__
    return '<%s %s / %s>' % (type(self).__name__, super().__str__(), self.__str__())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/client/ttypes.py", line 243, in __repr__
    return '<%s %s / %s>' % (type(self).__name__, super().__str__(), self.__str__())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/stig/client/ttypes.py", line 243, in __repr__
    return '<%s %s / %s>' % (type(self).__name__, super().__str__(), self.__str__())
  [Previous line repeated 487 more times]
RecursionError: maximum recursion depth exceeded
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x105587ee0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x105c43340>, 0.739198048)]']
connector: <aiohttp.connector.TCPConnector object at 0x105587e80>
rndusr commented 4 years ago

Works for me in current master.

tribeiros commented 4 years ago

On python3.6 works, thanks