bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.34k stars 1.46k forks source link

include() in template fail if have space between "include" and "(" #1258

Closed RimeOCRLIB closed 3 years ago

RimeOCRLIB commented 3 years ago

Unfortunately Bottle have a bag in include () function

% include ("my_template.tpl")  # template not found
% include("my_template.tpl")  # template found

the only difference it is space after "include" is forbidden Hope this issue message will help somebody save time in debugging

defnull commented 3 years ago

This is already fixed in master. include and rebase were keywords in 0.11 and change to being normal functions starting with 0.12. In 0.12 the old syntax is still supported, but it will yield a deprecation warning. The first version is interpreted as a keyword and is translated to include('("my_template.tpl")') which is wrong, obviously.