placeholder "$request" - is it now reserved?

Brian Bird <[email protected]> Mon, 6 Aug 2012 14:28:56 +0000
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
--===============4605661706340964321==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_6F7F60AEAD1E0D4B9958C3B7E7D2D4E31E857CSTExchange01Menai_"

--_000_6F7F60AEAD1E0D4B9958C3B7E7D2D4E31E857CSTExchange01Menai_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I've just upgraded from Cheetah 2.0 to Cheetah 2.4 and found the following =
code gives different output:

from Cheetah.Template import Template
print Template(source=3D"Hello $x $request",namespaces=3D{"x":"X", "request=
":"REQUEST"})

Cheetah 2.0:
Hello X REQUEST

Cheetah 2.4:
Hello X


It looks to me like the key "request" in the namespace is being replaced wi=
th a blank value. (If I change the key to "request2" for example, it works =
as I expect.) Is "$request" now reserved in the namespace? If so, are there=
 any others?

Note, this upgrade happened because I'm moving from Ubuntu 10.04 to Ubuntu =
12.04. This means python has also been upgraded from 2.6 to 2.7. I can't fi=
nd anything in the documentation to suggest this is a deliberate change. I =
have seen some examples with the placeholder "$request" all to do with Webw=
are/Webkit. I don't think I'm using either of these, but is there a way to =
know for sure?

Thanks,

Brian

--_000_6F7F60AEAD1E0D4B9958C3B7E7D2D4E31E857CSTExchange01Menai_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";
	mso-fareast-language:EN-US;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-GB" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">I&#8217;ve just upgraded from Cheetah 2.0 to Cheetah=
 2.4 and found the following code gives different output:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">from Cheetah.Template import Template<o:p></o:p></p>
<p class=3D"MsoNormal">print Template(source=3D&quot;Hello $x $request&quot=
;,namespaces=3D{&quot;x&quot;:&quot;X&quot;, &quot;request&quot;:&quot;REQU=
EST&quot;})<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Cheetah 2.0:<o:p></o:p></p>
<p class=3D"MsoNormal">Hello X REQUEST<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Cheetah 2.4:<o:p></o:p></p>
<p class=3D"MsoNormal">Hello X<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">It looks to me like the key &#8220;request&#8221; in=
 the namespace is being replaced with a blank value. (If I change the key t=
o &#8220;request2&#8221; for example, it works as I expect.) Is &#8220;$req=
uest&#8221; now reserved in the namespace? If so, are there any others?<o:p=
></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Note, this upgrade happened because I&#8217;m moving=
 from Ubuntu 10.04 to Ubuntu 12.04. This means python has also been upgrade=
d from 2.6 to 2.7. I can&#8217;t find anything in the documentation to sugg=
est this is a deliberate change. I have seen some
 examples with the placeholder &#8220;$request&#8221; all to do with Webwar=
e/Webkit. I don&#8217;t think I&#8217;m using either of these, but is there=
 a way to know for sure?<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Thanks,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Brian<o:p></o:p></p>
</div>
</body>
</html>

--_000_6F7F60AEAD1E0D4B9958C3B7E7D2D4E31E857CSTExchange01Menai_--


--===============4605661706340964321==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
--===============4605661706340964321==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

--===============4605661706340964321==--