While testing Nikola 8.0.0b2 I discovered that listing installed themes does not work for me (setup with pipenv).
Traceback (most recent call last):
File "/Users/niko/.virtualenvs/bikes.bembel.bytes-CZ5WGSwq/lib/python3.6/site-packages/doit/doit_cmd.py", line 177, in run
File "/Users/niko/.virtualenvs/bikes.bembel.bytes-CZ5WGSwq/lib/python3.6/site-packages/doit/cmd_base.py", line 127, in parse_execute
return self.execute(params, args)
File "/Users/niko/.virtualenvs/bikes.bembel.bytes-CZ5WGSwq/lib/python3.6/site-packages/nikola/plugin_categories.py", line 147, in execute
return self._execute(options, args)
File "/Users/niko/.virtualenvs/bikes.bembel.bytes-CZ5WGSwq/lib/python3.6/site-packages/nikola/plugins/command/theme.py", line 173, in _execute
File "/Users/niko/.virtualenvs/bikes.bembel.bytes-CZ5WGSwq/lib/python3.6/site-packages/nikola/plugins/command/theme.py", line 293, in list_installed
themes += [(i, os.path.join(tdir, i)) for i in os.listdir(tdir)]
FileNotFoundError: [Errno 2] No such file or directory: 'themes'
This PR fixes this by only listing existing directories.
The text was updated successfully, but these errors were encountered:
We are unable to convert the task to an issue at this time. Please try again.
The issue was successfully created but we are unable to update the comment at this time.
@Kwpolskaos.path.isdir follows symlinks so this is not a problem. In case the link is broken this will return False.
I would like to stick with isdir because it will return False in case we unexpectedly hit a file whereas exists would accept this.
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.