mirror of https://github.com/scrapy/scrapy.git
fix string manipulation in render_templatefile()
This commit is contained in:
parent
f5c54072ec
commit
56b3cf07ff
|
|
@ -10,7 +10,8 @@ def render_templatefile(path, **kwargs):
|
|||
|
||||
content = string.Template(raw).substitute(**kwargs)
|
||||
|
||||
with open(path.rstrip('.tmpl'), 'wb') as file:
|
||||
render_path = path[:-len('.tmpl')] if path.endswith('.tmpl') else path
|
||||
with open(render_path, 'wb') as file:
|
||||
file.write(content)
|
||||
if path.endswith('.tmpl'):
|
||||
os.remove(path)
|
||||
|
|
|
|||
Loading…
Reference in New Issue