collective / Products.PloneKeywordManager

Change, merge and delete keywords (AKA tags or subjects) in Plone.
https://pypi.org/project/Products.PloneKeywordManager/
4 stars 8 forks source link

UnicodeDecodeError #32

Closed serge73 closed 2 years ago

serge73 commented 4 years ago

The add-on does not work with languages other than English (Latin letters). For testing, I used Russian.

Plone 5.2.0 (5207) CMF 2.4.0 Zope 4.1.1 Python 2.7.16 (default, Apr 6 2019, 01:42:57) [GCC 8.3.0] PIL 6.1.0 (Pillow) WSGI: Вкл. Сервер: waitress 1.3.0

Products.PloneKeywordManager-3.0.2-py2.7.egg

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 155, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 337, in publish_module
  Module ZPublisher.WSGIPublisher, line 255, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 61, in call_object
  Module Products.PloneKeywordManager.browser.prefs_keywords_view, line 51, in __call__
  Module Products.PloneKeywordManager.browser.prefs_keywords_view, line 77, in changeKeywords
  Module Products.PloneKeywordManager.browser.prefs_keywords_view, line 101, in doReturn
  Module Products.CMFPlone.PloneTool, line 580, in addPortalMessage
  Module Products.statusmessages.adapter, line 36, in add
  Module zope.i18n, line 194, in translate
  Module zope.i18n.translationdomain, line 85, in translate
  Module zope.i18n.translationdomain, line 165, in _recursive_translate
  Module zope.i18n, line 244, in interpolate
  Module zope.i18n, line 239, in replace
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 0: ordinal not in range(128)
jensens commented 4 years ago

in Python 2.7 the addPortalMessage and logger.info(... in doReturn probably get a str instead of unicode. My hotfix by commenting line 101 and 103 in Products.PloneKeywordManager-3.0.2-py2.7.egg/Products/PloneKeywordManager/browser/prefs_keywords_view.py fixes it (but no message is shown).

flipmcf commented 2 years ago

This is related to #53 We need to apply a bit of a better fix.

flipmcf commented 2 years ago

This is only for python 2.7 ? I'm seeing good behavior on Python 3 (3.8.10 )

keyword-mgr-replace

jensens commented 2 years ago

So we go for a major and drop Python 3? I am all in.

flipmcf commented 2 years ago

I would hope @serge73 is ok with maintaining a Python 2.7 branch if they really need it.

jensens commented 2 years ago

a major version bump and a branch is always fine.

flipmcf commented 2 years ago

a major version bump and a branch is always fine.

So, you thinking PKM 4.0.0 ?

flipmcf commented 2 years ago

If a version 3.0.4 is cut, this can close.

May I suggest a tag here: https://github.com/collective/Products.PloneKeywordManager/commit/7d31fa331116f8a195f352c7dd25fa34b7ceebff