Re: [Zope] Different field conversion for lines and ulines : why?

2007-01-11 Thread Pascal Peregrina
Done:
 Issue 2263 of  Zope Bugs, Features, and Patches Collector [ZC]

Thanks.

Pascal


> De : Andreas Jung <[EMAIL PROTECTED]>
> Répondre à : Andreas Jung <[EMAIL PROTECTED]>
> Date : Thu, 11 Jan 2007 12:15:49 +0100
> À : Pascal Peregrina <[EMAIL PROTECTED]>, 
> Objet : Re: [Zope] Different field conversion for lines and ulines : why?
> 
> 
> 
> --On 11. Januar 2007 11:23:45 +0100 Pascal Peregrina
> <[EMAIL PROTECTED]> wrote:
> 
>> Hi,
>> 
>> I would like to know why lines fields are not converted with the same
>> logic as ulines fields in Zpublisher.Converters.
>> 
>> lines uses splitlines() while ulines uses split('\n')
>> 
>> This gives different result:
>>>>> ''.splitlines()
>> []
>>>>> ''.split('\n')
>> ['']
>>>>> u''.splitlines()
>> []
>>>>> u''.split('\n')
>> [u'']
>> 
>> So, when creating an empty Zope property for example, ulines version value
>> will be (u'',) while lines version value will be ()
>> 
>> 
> 
> Put this into the bugtracker. If possible with unittests and patches :-)
> 
> -aj
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Different field conversion for lines and ulines : why?

2007-01-11 Thread Andreas Jung



--On 11. Januar 2007 11:23:45 +0100 Pascal Peregrina 
<[EMAIL PROTECTED]> wrote:



Hi,

I would like to know why lines fields are not converted with the same
logic as ulines fields in Zpublisher.Converters.

lines uses splitlines() while ulines uses split('\n')

This gives different result:

''.splitlines()

[]

''.split('\n')

['']

u''.splitlines()

[]

u''.split('\n')

[u'']

So, when creating an empty Zope property for example, ulines version value
will be (u'',) while lines version value will be ()




Put this into the bugtracker. If possible with unittests and patches :-)

-aj

pgp3ZVWgDUS9G.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )