[Zope-dev] Data.fs corruption (reproducable)

Pavlos Christoforou pavlos@gaaros.com
Fri, 12 May 2000 09:40:37 -0400 (EDT)


On Fri, 12 May 2000, Dr. Peer Griebel wrote:

> def FormatPreis( v, n=2, thou=regex.compile(
>                      "\([0-9]\)\([0-9][0-9][0-9]\([,.]\|$\)\)").search):
> 	v = "%.*f" % ( n, v )
> 	vl = string.split(v,'.')
> 	if not vl: return v
> 	v=vl[0]
> 	del vl[0]
> 	if vl: s = ',' + string.join(vl,',')
> 	else: s = ''
> 	l=thou(v)
> 	while l >= 0:
> 		v=v[:l+1]+'.'+v[l+1:]
> 		l=thou(v)
> 	return v+s
> 
> my data.fs stays intact! So what's happening here??? I hope there is no
> major problem within Zope. But I would like to see a hint what's going
> on.

Hmm my guess is that the problem arises because you pass the regex as a
default argument. 

Pavlos