Repository: getnikola/nikola

Issue:
Error loading tasks (exception). AttributeError: 'NoneType' object has no attribute 'split'.
**Python Version:** 3.6.8

**Nikola Version:** 8.0.2

**Operating System:** 64-bit GNU/Linux 4.15.0-20-generic; distro: Mint 19.1 (a fork of Ubuntu)

### Description:

Tried to build an empty site (no posts/pages), just some Jinja2 templates.

```
$ nikola build
Scanning posts........done!
[2019-08-04T13:06:35Z] ERROR: Nikola: Error loading tasks. An unhandled exception occurred.
[2019-08-04T13:06:35Z] ERROR: Nikola: AttributeError: 'NoneType' object has no attribute 'split'
[2019-08-04T13:06:35Z] NOTICE: Nikola: To see more details, run Nikola in debug mode (set environment variable NIKOLA_DEBUG=1) or use NIKOLA_SHOW_TRACEBACKS=1
```

With debug on:

First, I get a huge spam of errors (hundreds/thousands of entries) looking like this. Seems like yapsy has something wrong with `venv` directory but ... the venv directory is 1 level higher than the directory where the website is and Nikola is run.

```
[2019-08-04T13:11:17Z] DEBUG: yapsy: correct subclass tests failed for: sc in /home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/plugins/compile/html
Traceback (most recent call last):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/yapsy/PluginManager.py", line 535, in loadPlugins
    is_correct_subclass = issubclass(element, self.categories_interfaces[category_name])
TypeError: issubclass() arg 1 must be a class
[2019-08-04T13:11:17Z] DEBUG: yapsy: correct subclass tests failed for: write_metadata in /home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/plugins/compile/html
Traceback (most recent call last):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/yapsy/PluginManager.py", line 535, in loadPlugins
    is_correct_subclass = issubclass(element, self.categories_interfaces[category_name])
TypeError: issubclass() arg 1 must be a class
``` 

Then this at the end:

```
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "yapsy_loaded_plugin_mdx_nikola_0.NikolaExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "yapsy_loaded_plugin_mdx_podcast_0.PodcastExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "yapsy_loaded_plugin_mdx_gist_0.GistExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.fenced_code".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.fenced_code.FencedCodeExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.codehilite".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.codehilite.CodeHiliteExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.extra".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.smart_strong".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.smart_strong.SmartEmphasisExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.fenced_code".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.fenced_code.FencedCodeExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.footnotes".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.footnotes.FootnoteExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.attr_list".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.attr_list.AttrListExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.def_list".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.def_list.DefListExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.tables".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.tables.TableExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfuly imported extension module "markdown.extensions.abbr".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.abbr.AbbrExtension".
[2019-08-04T13:11:17Z] DEBUG: MARKDOWN: Successfully loaded extension "markdown.extensions.extra.ExtraExtension".
Scanning posts........done!
[2019-08-04T13:11:17Z] ERROR: Nikola: Error loading tasks. An unhandled exception occurred.
Traceback (most recent call last):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/doit/doit_cmd.py", line 177, in run
    return command.parse_execute(args)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/doit/cmd_base.py", line 127, in parse_execute
    return self.execute(params, args)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/doit/cmd_base.py", line 389, in execute
    self, params, args)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/__main__.py", line 277, in load_tasks
    self.nikola.gen_tasks('render_site', "Task", 'Group of tasks to render the site.'))
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/doit/loader.py", line 313, in generate_tasks
    for task_dict, x_doc in flat_generator(gen_result, gen_doc):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/doit/loader.py", line 26, in flat_generator
    for item in gen:
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/nikola.py", line 1956, in gen_tasks
    for task in flatten(pluginInfo.plugin_object.gen_tasks()):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/nikola.py", line 1950, in flatten
    for t in task:
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/plugins/task/pages.py", line 66, in gen_tasks
    for task in self.site.generic_page_renderer(lang, post, kw["filters"], context):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/nikola.py", line 2262, in generic_page_renderer
    url_type=post.url_type)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/nikola.py", line 2166, in generic_renderer
    file_deps += self.template_system.template_deps(template_name)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/plugins/template/jinja.py", line 129, in template_deps
    self.dependency_cache[template_name] = [filename] + self.get_deps(filename)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/plugins/template/jinja.py", line 123, in get_deps
    return self.get_string_deps(text)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/nikola/plugins/template/jinja.py", line 113, in get_string_deps
    filename = self.lookup.loader.get_source(self.lookup, dep_name)[1]
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/jinja2/loaders.py", line 168, in get_source
    pieces = split_template_path(template)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.6/site-packages/jinja2/loaders.py", line 27, in split_template_path
    for piece in template.split('/'):
AttributeError: 'NoneType' object has no attribute 'split'
```


Discussion:
Yapsy error spam shows up when running any Nikola command, even `--help`.
I can't reproduce with the given data. Could you make a zip file with the site showing the problem?

Also: version of nikola?
to reproduce: `git clone https://github.com/Xeverous/the_website.git && git checkout test-nikola-error-loading-task`

> Also: version of nikola?

specified at the top
Checked out your repo, checked out the branch, installed nikola 8.0.2 via pip, no error.

Could you cleanup your virtual environment and reinstall? Maybe it's some old pyc file or something.

deactivated, then `rm -rf venv` and ... I needed to install `virtualenv` in order to use it again (perhaps that was some self-managed installation or something from pipenv)

Did `sudo apt install virtualenv` and `virtualenv -p python3.7 venv`, entered directory, `pip install -I --upgrade "Nikola[extras]"` and still the same thing:

```
$ nikola build
Scanning posts........done!
[2019-08-04T14:35:22Z] ERROR: Nikola: Error loading tasks. An unhandled exception occurred.
Traceback (most recent call last):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/doit_cmd.py", line 177, in run
    return command.parse_execute(args)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/cmd_base.py", line 127, in parse_execute
    return self.execute(params, args)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/cmd_base.py", line 389, in execute
    self, params, args)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/__main__.py", line 277, in load_tasks
    self.nikola.gen_tasks('render_site', "Task", 'Group of tasks to render the site.'))
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/loader.py", line 313, in generate_tasks
    for task_dict, x_doc in flat_generator(gen_result, gen_doc):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/loader.py", line 26, in flat_generator
    for item in gen:
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 1956, in gen_tasks
    for task in flatten(pluginInfo.plugin_object.gen_tasks()):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 1950, in flatten
    for t in task:
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/task/pages.py", line 66, in gen_tasks
    for task in self.site.generic_page_renderer(lang, post, kw["filters"], context):
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 2262, in generic_page_renderer
    url_type=post.url_type)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 2166, in generic_renderer
    file_deps += self.template_system.template_deps(template_name)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 129, in template_deps
    self.dependency_cache[template_name] = [filename] + self.get_deps(filename)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 123, in get_deps
    return self.get_string_deps(text)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 113, in get_string_deps
    filename = self.lookup.loader.get_source(self.lookup, dep_name)[1]
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/jinja2/loaders.py", line 168, in get_source
    pieces = split_template_path(template)
  File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/jinja2/loaders.py", line 27, in split_template_path
    for piece in template.split('/'):
AttributeError: 'NoneType' object has no attribute 'split'
```
Reproduced! Give me a few minutes to figure it out.


On Sun, Aug 4, 2019 at 11:37 AM Xeverous <notifications@github.com> wrote:

> deactivated, then rm -rf venv and ... I needed to install virtualenv in
> order to use it again (perhaps that was some self-managed installation or
> something from pipenv)
>
> Did sudo apt install virtualenv and virtualenv -p python3.7 venv, entered
> directory and still the same thing:
>
> $ nikola build
> Scanning posts........done!
> [2019-08-04T14:35:22Z] ERROR: Nikola: Error loading tasks. An unhandled exception occurred.
> Traceback (most recent call last):
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/doit_cmd.py", line 177, in run
>     return command.parse_execute(args)
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/cmd_base.py", line 127, in parse_execute
>     return self.execute(params, args)
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/cmd_base.py", line 389, in execute
>     self, params, args)
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/__main__.py", line 277, in load_tasks
>     self.nikola.gen_tasks('render_site', "Task", 'Group of tasks to render the site.'))
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/loader.py", line 313, in generate_tasks
>     for task_dict, x_doc in flat_generator(gen_result, gen_doc):
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/loader.py", line 26, in flat_generator
>     for item in gen:
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 1956, in gen_tasks
>     for task in flatten(pluginInfo.plugin_object.gen_tasks()):
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 1950, in flatten
>     for t in task:
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/task/pages.py", line 66, in gen_tasks
>     for task in self.site.generic_page_renderer(lang, post, kw["filters"], context):
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 2262, in generic_page_renderer
>     url_type=post.url_type)
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 2166, in generic_renderer
>     file_deps += self.template_system.template_deps(template_name)
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 129, in template_deps
>     self.dependency_cache[template_name] = [filename] + self.get_deps(filename)
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 123, in get_deps
>     return self.get_string_deps(text)
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 113, in get_string_deps
>     filename = self.lookup.loader.get_source(self.lookup, dep_name)[1]
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/jinja2/loaders.py", line 168, in get_source
>     pieces = split_template_path(template)
>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/jinja2/loaders.py", line 27, in split_template_path
>     for piece in template.split('/'):
> AttributeError: 'NoneType' object has no attribute 'split'
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/getnikola/nikola/issues/3279?email_source=notifications&email_token=AAAAMK6RGLWTVEIFEGOMOM3QC3SS3A5CNFSM4IJFIME2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3QDADY#issuecomment-518008847>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAAAMK5XFYV43PMUVYMRBG3QC3SS3ANCNFSM4IJFIMEQ>
> .
>

I have narrowed this to your theme.

Looks like something in our jinja dependency detector is not capable of
understanding it.
Should be easy-ish to fix, hopefully I can give you a patch today, life
permitting.

On Sun, Aug 4, 2019 at 11:55 AM Roberto Alsina <ralsina@kde.org> wrote:

>
> Reproduced! Give me a few minutes to figure it out.
>
>
> On Sun, Aug 4, 2019 at 11:37 AM Xeverous <notifications@github.com> wrote:
>
>> deactivated, then rm -rf venv and ... I needed to install virtualenv in
>> order to use it again (perhaps that was some self-managed installation or
>> something from pipenv)
>>
>> Did sudo apt install virtualenv and virtualenv -p python3.7 venv,
>> entered directory and still the same thing:
>>
>> $ nikola build
>> Scanning posts........done!
>> [2019-08-04T14:35:22Z] ERROR: Nikola: Error loading tasks. An unhandled exception occurred.
>> Traceback (most recent call last):
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/doit_cmd.py", line 177, in run
>>     return command.parse_execute(args)
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/cmd_base.py", line 127, in parse_execute
>>     return self.execute(params, args)
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/cmd_base.py", line 389, in execute
>>     self, params, args)
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/__main__.py", line 277, in load_tasks
>>     self.nikola.gen_tasks('render_site', "Task", 'Group of tasks to render the site.'))
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/loader.py", line 313, in generate_tasks
>>     for task_dict, x_doc in flat_generator(gen_result, gen_doc):
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/loader.py", line 26, in flat_generator
>>     for item in gen:
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 1956, in gen_tasks
>>     for task in flatten(pluginInfo.plugin_object.gen_tasks()):
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 1950, in flatten
>>     for t in task:
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/task/pages.py", line 66, in gen_tasks
>>     for task in self.site.generic_page_renderer(lang, post, kw["filters"], context):
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 2262, in generic_page_renderer
>>     url_type=post.url_type)
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 2166, in generic_renderer
>>     file_deps += self.template_system.template_deps(template_name)
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 129, in template_deps
>>     self.dependency_cache[template_name] = [filename] + self.get_deps(filename)
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 123, in get_deps
>>     return self.get_string_deps(text)
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 113, in get_string_deps
>>     filename = self.lookup.loader.get_source(self.lookup, dep_name)[1]
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/jinja2/loaders.py", line 168, in get_source
>>     pieces = split_template_path(template)
>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/jinja2/loaders.py", line 27, in split_template_path
>>     for piece in template.split('/'):
>> AttributeError: 'NoneType' object has no attribute 'split'
>>
>> —
>> You are receiving this because you commented.
>> Reply to this email directly, view it on GitHub
>> <https://github.com/getnikola/nikola/issues/3279?email_source=notifications&email_token=AAAAMK6RGLWTVEIFEGOMOM3QC3SS3A5CNFSM4IJFIME2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3QDADY#issuecomment-518008847>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AAAAMK5XFYV43PMUVYMRBG3QC3SS3ANCNFSM4IJFIMEQ>
>> .
>>
>

When Nikola tries to find the dependencies of a template in your theme,
it's getting a list of Nones.

That is normal according to the docs, it just seems nobody ever tried to do
that in a Nikola theme yet:

If dynamic inheritance or inclusion is used, `None` will be
yielded.

Patch coming up.

On Sun, Aug 4, 2019 at 12:08 PM Roberto Alsina <ralsina@kde.org> wrote:

> I have narrowed this to your theme.
>
> Looks like something in our jinja dependency detector is not capable of
> understanding it.
> Should be easy-ish to fix, hopefully I can give you a patch today, life
> permitting.
>
> On Sun, Aug 4, 2019 at 11:55 AM Roberto Alsina <ralsina@kde.org> wrote:
>
>>
>> Reproduced! Give me a few minutes to figure it out.
>>
>>
>> On Sun, Aug 4, 2019 at 11:37 AM Xeverous <notifications@github.com>
>> wrote:
>>
>>> deactivated, then rm -rf venv and ... I needed to install virtualenv in
>>> order to use it again (perhaps that was some self-managed installation or
>>> something from pipenv)
>>>
>>> Did sudo apt install virtualenv and virtualenv -p python3.7 venv,
>>> entered directory and still the same thing:
>>>
>>> $ nikola build
>>> Scanning posts........done!
>>> [2019-08-04T14:35:22Z] ERROR: Nikola: Error loading tasks. An unhandled exception occurred.
>>> Traceback (most recent call last):
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/doit_cmd.py", line 177, in run
>>>     return command.parse_execute(args)
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/cmd_base.py", line 127, in parse_execute
>>>     return self.execute(params, args)
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/cmd_base.py", line 389, in execute
>>>     self, params, args)
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/__main__.py", line 277, in load_tasks
>>>     self.nikola.gen_tasks('render_site', "Task", 'Group of tasks to render the site.'))
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/loader.py", line 313, in generate_tasks
>>>     for task_dict, x_doc in flat_generator(gen_result, gen_doc):
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/doit/loader.py", line 26, in flat_generator
>>>     for item in gen:
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 1956, in gen_tasks
>>>     for task in flatten(pluginInfo.plugin_object.gen_tasks()):
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 1950, in flatten
>>>     for t in task:
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/task/pages.py", line 66, in gen_tasks
>>>     for task in self.site.generic_page_renderer(lang, post, kw["filters"], context):
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 2262, in generic_page_renderer
>>>     url_type=post.url_type)
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/nikola.py", line 2166, in generic_renderer
>>>     file_deps += self.template_system.template_deps(template_name)
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 129, in template_deps
>>>     self.dependency_cache[template_name] = [filename] + self.get_deps(filename)
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 123, in get_deps
>>>     return self.get_string_deps(text)
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/nikola/plugins/template/jinja.py", line 113, in get_string_deps
>>>     filename = self.lookup.loader.get_source(self.lookup, dep_name)[1]
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/jinja2/loaders.py", line 168, in get_source
>>>     pieces = split_template_path(template)
>>>   File "/home/xeverous/workspace/the_website/venv/lib/python3.7/site-packages/jinja2/loaders.py", line 27, in split_template_path
>>>     for piece in template.split('/'):
>>> AttributeError: 'NoneType' object has no attribute 'split'
>>>
>>> —
>>> You are receiving this because you commented.
>>> Reply to this email directly, view it on GitHub
>>> <https://github.com/getnikola/nikola/issues/3279?email_source=notifications&email_token=AAAAMK6RGLWTVEIFEGOMOM3QC3SS3A5CNFSM4IJFIME2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3QDADY#issuecomment-518008847>,
>>> or mute the thread
>>> <https://github.com/notifications/unsubscribe-auth/AAAAMK5XFYV43PMUVYMRBG3QC3SS3ANCNFSM4IJFIMEQ>
>>> .
>>>
>>


Resolving patch:
diff --git a/nikola/plugins/template/jinja.py b/nikola/plugins/template/jinja.py
--- a/nikola/plugins/template/jinja.py
+++ b/nikola/plugins/template/jinja.py
@@ -108,7 +108,7 @@ def get_string_deps(self, text):
         """Find dependencies for a template string."""
         deps = set([])
         ast = self.lookup.parse(text)
-        dep_names = meta.find_referenced_templates(ast)
+        dep_names = [d for d in meta.find_referenced_templates(ast) if d]
         for dep_name in dep_names:
             filename = self.lookup.loader.get_source(self.lookup, dep_name)[1]
             sub_deps = [filename] + self.get_deps(filename)


Test patch: