[Zope-dev] Strings as input to the in tag: inconsistent
Thilo Mezger
thilo@eevolute.com
Thu, 27 May 1999 10:47:56 +0200
Martijn Pieters wrote:
>
> Are you sure you are using the same version of python on both platforms?
well, python-1.5.1 on linux using the zope-1.10.2 source install and the
binary installation on win95 but that also ships with python-1.5.1
> You should get the same error on Linux as well, but it seems that
> string.uppercase there returns a sequence of a type other than string.
but i don't want to get the same error on linux - i want the win95 version
to work!!! :-)
> 1. If it doesn't, that's where your problem lies. If 0, look at
> 'type(string.uppercase)'. I do not know what it will say, but whatever it
> is, it probably will be a bug.
nope, everything seems to be OK with my python/linux: the type of
string.uppercase is StringType and type(string.uppercase)==type('') returns
1.
what i have tried now is this:
<!--#in title_or_id-->
<!--#var sequence-item-->
<!--#/in-->
with "title_or_id" being the built-in DTML string property of course. and
again: linux does it but win95 fails (as usual you might say - but
probably not with zope... :-)
i've had a look at DT_In.py and there's this code in the renderwb method
(on both platforms of course):
if type(sequence) is type(''):
raise 'InError', (
'Strings are not allowed as input to the in tag.')
why aren't strings allowed as input? in python, strings are sequence types
(see ch. 3.2 in the python reference guide) - so why shouldn't i use them
with the #in-tag?! and my zope/linux proves that this is possible...
could someone please spread some light on this strange phenomena...?!
confused...
thilo