mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-24 23:43:59 +00:00
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…
x
Reference in New Issue
Block a user