[Zope-CMF] SVN: Products.CMFCore/branches/2.2/Products/CMFCore/exportimport/content.py remove type check that seem useless

Tres Seaver tseaver at palladion.com
Thu Jan 13 09:04:06 EST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/13/2011 06:00 AM, Godefroid Chapelle wrote:
> Log message for revision 119561:
>   remove type check that seem useless
> 
> Changed:
>   U   Products.CMFCore/branches/2.2/Products/CMFCore/exportimport/content.py
> 
> -=-
> Modified: Products.CMFCore/branches/2.2/Products/CMFCore/exportimport/content.py
> ===================================================================
> --- Products.CMFCore/branches/2.2/Products/CMFCore/exportimport/content.py	2011-01-13 10:44:41 UTC (rev 119560)
> +++ Products.CMFCore/branches/2.2/Products/CMFCore/exportimport/content.py	2011-01-13 11:00:16 UTC (rev 119561)
> @@ -101,15 +101,9 @@
>          parser = ConfigParser()
>  
>          title = self.context.Title()
> -        if isinstance(title, unicode):
> -            title_str = title.encode(self._encoding)
> -        else:
> -            title_str = title
> +        title_str = title.encode(self._encoding)
>          description = self.context.Description()
> -        if isinstance(description, unicode):
> -            description_str = description.encode(self._encoding)
> -        else:
> -            description_str = description
> +        description_str = description.encode(self._encoding)
>          parser.set('DEFAULT', 'Title', title_str)
>          parser.set('DEFAULT', 'Description', description_str)

This change should be reverted -- you now double-encode any
already-encoded UTF=8 strings.  We should probably add a test for that
condition.


Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0vBlYACgkQ+gerLs4ltQ5vywCgyX7rpPpzg6Fc7npRR3LNzqy4
52EAnilxgrvKl27A8v9Vdbg3S+0DcnLQ
=2zAv
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list