Skip to content
This repository

Mako generated paths don't always work on Windows #512

Closed
Themanwithoutaplan opened this Issue March 26, 2012 · 3 comments

2 participants

Themanwithoutaplan Chris McDonough
Themanwithoutaplan

This is based on an error from the debugtoolbar demo that will not run on Windows because path names containing ":" are illegal on Windows. Original issue Pylons/pyramid_debugtoolbar#58 (comment)

Files required are at https://gist.github.com/2205313

Sample traceback
"""
Traceback (most recent call last):
File "c:\python27\Lib\wsgiref\handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "C:\Temp\sprint\lib\site-packages\pyramid\router.py", line 187, in call
__
response = self.handle_request(request)
File "C:\Temp\sprint\lib\site-packages\pyramid\tweens.py", line 20, in excview
_tween
response = handler(request)
File "C:\Temp\sprint\lib\site-packages\pyramid\router.py", line 164, in handle
_request
response = view_callable(context, request)
File "C:\Temp\sprint\lib\site-packages\pyramid\config\views.py", line 350, in
rendered_view
context)
File "C:\Temp\sprint\lib\site-packages\pyramid\renderers.py", line 396, in ren
der_view
return self.render_to_response(response, system, request=request)
File "C:\Temp\sprint\lib\site-packages\pyramid\renderers.py", line 426, in ren
der_to_response
result = self.render(value, system_values, request=request)
File "C:\Temp\sprint\lib\site-packages\pyramid\renderers.py", line 422, in ren
der
result = renderer(value, system_values)
File "C:\Temp\sprint\lib\site-packages\pyramid\mako_templating.py", line 171,
in __call

template = self.implementation()
File "C:\Temp\sprint\lib\site-packages\pyramid\mako_templating.py", line 158,
in implementation
return self.lookup.get_template(self.path)
File "C:\Temp\sprint\lib\site-packages\pyramid\mako_templating.py", line 60, i
n get_template
return self.load(srcfile, uri)
File "C:\Temp\sprint\lib\site-packages\mako\lookup.py", line 299, in _load
**self.template_args)
File "C:\Temp\sprint\lib\site-packages\mako\template.py", line 267, in __init

_
module = self.compile_from_file(path, filename)
File "C:\Temp\sprint\lib\site-packages\mako\template.py", line 306, in compil
e_from_file
util.verify_directory(os.path.dirname(path))
File "C:\Temp\sprint\lib\site-packages\mako\util.py", line 104, in verify_dire
ctory
os.makedirs(dir, 0775)
File "C:\Temp\sprint\lib\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 267] Der Verzeichnisname ist ungⁿltig: 'C:\Temp\sprint\t
oolbar\demo\mako_modules\__main
:templates'
.psf - - [26/Mar/2012 14:48:25] "GET /favicon.ico HTTP/1.1" 500 59
"""

Chris McDonough
Owner

Thanks! I've fixed this in the master and the 1.3 branch. See 4321a44 for details.

Chris McDonough mcdonc closed this March 26, 2012
Themanwithoutaplan

Colour me stupid but I don't quite understand the logic of the chosen paths as they stand: "main:templates" doesn't look to me like a path (well, an old-style Mac OS one maybe) but like something out of setuptools. I'm guessing that that is the reason: mirroring some kind of egg structure? Anyway glad to have been able to help.

Wayne Witzel III wwitzel3 referenced this issue from a commit in wwitzel3/pyramid March 26, 2012
Chris McDonough speculative fix for issue #512 cedf57c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.