{"action":"opened","issue":{"url":"https://api.github.com/repos/getnikola/nikola/issues/2109","labels_url":"https://api.github.com/repos/getnikola/nikola/issues/2109/labels{/name}","comments_url":"https://api.github.com/repos/getnikola/nikola/issues/2109/comments","events_url":"https://api.github.com/repos/getnikola/nikola/issues/2109/events","html_url":"https://github.com/getnikola/nikola/issues/2109","id":107591594,"number":2109,"title":"Possible bug in `get_asset_path`?","user":{"login":"felixfontein","id":5781356,"avatar_url":"https://avatars.githubusercontent.com/u/5781356?v=3","gravatar_id":"","url":"https://api.github.com/users/felixfontein","html_url":"https://github.com/felixfontein","followers_url":"https://api.github.com/users/felixfontein/followers","following_url":"https://api.github.com/users/felixfontein/following{/other_user}","gists_url":"https://api.github.com/users/felixfontein/gists{/gist_id}","starred_url":"https://api.github.com/users/felixfontein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixfontein/subscriptions","organizations_url":"https://api.github.com/users/felixfontein/orgs","repos_url":"https://api.github.com/users/felixfontein/repos","events_url":"https://api.github.com/users/felixfontein/events{/privacy}","received_events_url":"https://api.github.com/users/felixfontein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-21T20:26:02Z","updated_at":"2015-09-21T20:26:02Z","closed_at":null,"body":"As mentioned in #2106, I think `nikola.util.get_asset_path` might have a bug, or it is used incorrectly. Or (third possiblity), I understand it wrongly what it is supposed to do.\r\n\r\nI understand it as follows: if you want to know whether `output/bla/test.txt` is created by either the themes or by copying files (or already created by another plugin or by magic when called in `gen_tasks`), you do `get_asset_path('bla/test.txt', themes, files_folders)` and see if it returns `None` or a path.\r\n\r\nI looked at how it is used for example in the `robots` plugin to detect whether `output/robots.txt` is created, and it seems to confirm my idea.\r\n\r\nIf that's correct, then it will fail in the following situation: assume that you have `file_folders = {'a': 'b'}` and have a file `a/bla/test.txt`. This will be copied to `output/b/bla/test.txt`. On the other hand, `get_asset_path('bla/test.txt', themes, files_folders)` will return `a/bla/test.txt`, so I assume that `output/bla/test.txt` will be created -- which it won't.\r\n\r\nSo -- do I understand it wrong what `get_asset_path` does, or is there a bug in its implementation? (Or am I somehow else confused? :) )"}}