[Zope-dev] bug in handling of :tokens:int

Service Informatique CHSR chsrinfo@guetali.fr
Wed, 12 May 1999 17:19:26 +0400


Message en plusieurs parties et au format MIME.

------=_NextPart_000_002B_01BE9C9B.96557740
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hello,

Zope 1.1.0.2
using :tokens:int (to have "1 2 3" --> [1, 2, 3]) doesn't work

Included is a patch against lib/python/ZPublisher/Converters.py
Basically, field2whatever recursively calls field2whatever if its
argument is a list or a sequence, where 'whatever' is int, float, or
long

Also, field2date appears twice in this file. The patch also corrects this.

I don't know if someone already discovered the problem (don't have access
to CVS), but in case it can help someone...

Also, my timezone tzname is 'RET' (I live in Reunion Island). It is GMT+4
I don't know the official name for my timezone, but i someone could
add this to lib/python/DateTime/DateTime.py

Regards,
Jephte CLAIN
Service Informatique CHSR


------=_NextPart_000_002B_01BE9C9B.96557740
Content-Type: application/octet-stream;
	name="Converters.py.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="Converters.py.patch"

LS0tIENvbnZlcnRlcnMucHkub3JpZwlXZWQgTWF5IDEyIDE0OjUyOjU5IDE5OTkKKysrIENvbnZl
cnRlcnMucHkJV2VkIE1heSAxMiAxNTozMDowOSAxOTk5CkBAIC04Niw2ICs4Niw3IEBACiAKIGlt
cG9ydCByZWdleAogZnJvbSBzdHJpbmcgaW1wb3J0IGF0b2ksIGF0b2wsIGF0b2YsIGpvaW4sIHNw
bGl0LCBzdHJpcAorZnJvbSB0eXBlcyBpbXBvcnQgTGlzdFR5cGUsIFR1cGxlVHlwZQogCiBkZWYg
ZmllbGQyc3RyaW5nKHYpOgogICAgIGlmIGhhc2F0dHIodiwncmVhZCcpOiB2PXYucmVhZCgpCkBA
IC0xMTQsNiArMTE1LDggQEAKICAgICByYWlzZSBWYWx1ZUVycm9yLCAnTm8gaW5wdXQgZm9yIHJl
cXVpcmVkIGZpZWxkPHA+JwogCiBkZWYgZmllbGQyaW50KHYpOgorICAgIGl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