Closed
Conversation
Traceback (most recent call last):
File "/usr/local/bin/flexget", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/flexget/__init__.py", line 44, in main
manager.start()
File "/usr/local/lib/python3.9/dist-packages/flexget/manager.py", line 383, in start
self.handle_cli()
File "/usr/local/lib/python3.9/dist-packages/flexget/manager.py", line 412, in handle_cli
options.cli_command_callback(self, command_options)
File "/usr/local/lib/python3.9/dist-packages/flexget/plugins/cli/templates.py", line 31, in list_file_templates
table.add_row(name, plugin, template.filename, '')
File "/usr/local/lib/python3.9/dist-packages/rich/table.py", line 423, in add_row
raise errors.NotRenderableError(
rich.errors.NotRenderableError: unable to render list; a string or other renderable object is required
gazpachoking
reviewed
Mar 6, 2022
| @@ -19,8 +19,11 @@ def list_file_templates(manager, options): | |||
| else: | |||
| plugin = '-' | |||
| name = template_name.replace('.template', '').split('/') | |||
Member
There was a problem hiding this comment.
I think we can just go with this change, and skip all the rest. The result of a str.split is always a list, so no need to check that, and there will always be at least one part, because all the templates will have a name.
Suggested change
| name = template_name.replace('.template', '').split('/') | |
| name = template_name.replace('.template', '').split('/')[-1] |
paranoidi
reviewed
Mar 11, 2022
| name = template_name.replace('.template', '').split('/') | ||
| if len(name) == 2: | ||
| name = name[1] | ||
| if type(name) == list: |
Member
There was a problem hiding this comment.
Using instanceof to check type is preferable
Member
|
Thanks for the report and PR! Went with a slightly simpler fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Traceback (most recent call last):
File "/usr/local/bin/flexget", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/flexget/init.py", line 44, in main
manager.start()
File "/usr/local/lib/python3.9/dist-packages/flexget/manager.py", line 383, in start
self.handle_cli()
File "/usr/local/lib/python3.9/dist-packages/flexget/manager.py", line 412, in handle_cli
options.cli_command_callback(self, command_options)
File "/usr/local/lib/python3.9/dist-packages/flexget/plugins/cli/templates.py", line 31, in list_file_templates
table.add_row(name, plugin, template.filename, '')
File "/usr/local/lib/python3.9/dist-packages/rich/table.py", line 423, in add_row
raise errors.NotRenderableError(
rich.errors.NotRenderableError: unable to render list; a string or other renderable object is required