Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
FileSystemLoader doesn't work with Windows paths (backslashes) #767
On Windows, when using
Traceback (most recent call last): File "./scripts/generateBoard.py", line 186, in <module> metadata = jinjaEnvironment.get_template(metadataFile).render(dictionary = d ictionary) File "C:\Python27\lib\site-packages\jinja2\environment.py", line 830, in get_t emplate return self._load_template(name, self.make_globals(globals)) File "C:\Python27\lib\site-packages\jinja2\environment.py", line 804, in _load _template template = self.loader.load(self, name, globals) File "C:\Python27\lib\site-packages\jinja2\loaders.py", line 113, in load source, filename, uptodate = self.get_source(environment, name) File "C:\Python27\lib\site-packages\jinja2\loaders.py", line 168, in get_sourc e pieces = split_template_path(template) File "C:\Python27\lib\site-packages\jinja2\loaders.py", line 31, in split_temp late_path raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: .\source\architecture\ARM\ARMv6-M-ARMv7-M\bo ardTemplates\ARMv6-M-ARMv7-M.metadata
I think this information should be explicitly stated in the documentation with bold font if you don't intend to fix it. It's not that I have purposefully used backslashes - when generating the filename using some other python code (for example by searching the folders for appropriate extensions), the string has system's native slashes (so backslashes on Windows). In that case you have to explicitly replace the slashes...
BTW - I'm not using Windows, but I'm writing a script which should work on all platforms.