plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
254 stars 191 forks source link

backport safe_nativestring to Plone 5.0 and 5.1 #2596

Open pbauer opened 6 years ago

pbauer commented 6 years ago

safe_nativestring is useful when writing py2 and py3 compatible code. It could be used in may places, e.g. https://github.com/plone/Products.PortalTransforms/pull/38. To allow the use in addons that support Plone 5.2 and older versions we should add it to 5.0 and 5.1 as well.

ale-rt commented 6 years ago

safe_nativestring is really great! A little bit off topic, what about also renaming safe_unicode and safe_encode to safe_text and safe_bytes?

Regarding the fact to backport that method to Plone <5.2 I am not sure if this will cause confusion. You are adding a feature that will be available only for some minor versions of Plone.

That can cause some headaches.