UnicodeDecodeError when renaming a site name plone

Plone 4.2.5 is updated from 4.1.4, default_language is zh-cn, default_charset is utf-8 (portal_properties / site_properties).

when I try to rename the Plone site name on the root page to ip: 8080 /, the site error is displayed:

An error was encountered while publishing this resource. Error Type: UnicodeDecodeError Error Value: ('ascii', '\xe8\xa2\x81\xe4\xba\x88\xe6\xb9\x98', 0, 1, 'ordinal not in range(128)') Traceback (innermost last): Module ZPublisher.Publish, line 126, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 46, in call_object Module OFS.CopySupport, line 333, in manage_renameObjects Module OFS.CopySupport, line 369, in manage_renameObject Module zope.event, line 31, in notify Module zope.component.event, line 24, in dispatch Module zope.component._api, line 136, in subscribers Module zope.component.registry, line 321, in subscribers Module zope.interface.adapter, line 585, in subscribers Module zope.component.event, line 32, in objectEventNotify Module zope.component._api, line 136, in subscribers Module zope.component.registry, line 321, in subscribers Module zope.interface.adapter, line 585, in subscribers Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent Module zope.container.contained, line 153, in dispatchToSublocations Module zope.component._api, line 136, in subscribers Module zope.component.registry, line 321, in subscribers Module zope.interface.adapter, line 585, in subscribers Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent Module zope.container.contained, line 153, in dispatchToSublocations Module zope.component._api, line 136, in subscribers Module zope.component.registry, line 321, in subscribers Module zope.interface.adapter, line 585, in subscribers Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent Module zope.container.contained, line 153, in dispatchToSublocations Module zope.component._api, line 136, in subscribers Module zope.component.registry, line 321, in subscribers Module zope.interface.adapter, line 585, in subscribers Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent Module zope.container.contained, line 153, in dispatchToSublocations Module zope.component._api, line 136, in subscribers Module zope.component.registry, line 321, in subscribers Module zope.interface.adapter, line 585, in subscribers Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent Module zope.container.contained, line 153, in dispatchToSublocations Module zope.component._api, line 136, in subscribers Module zope.component.registry, line 321, in subscribers Module zope.interface.adapter, line 585, in subscribers Module Products.CMFCore.CMFCatalogAware, line 271, in handleContentishEvent Module Products.Archetypes.CatalogMultiplex, line 49, in unindexObject Module Products.CMFPlone.CatalogTool, line 393, in uncatalog_object Module Products.ZCatalog.ZCatalog, line 508, in uncatalog_object Module Products.ZCatalog.Catalog, line 369, in uncatalogObject Module Products.PluginIndexes.common.UnIndex, line 286, in unindex_object Module Products.PluginIndexes.common.UnIndex, line 157, in removeForwardIndexEntry UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 0: ordinal not in range(128) 

UnicodeDecodeError problems ever occurred when I tried to import some folders to the newly created Plone site.

I have successfully renamed another Plone site name. I can not say what is the difference between them. :(

+6
source share
1 answer

Your site, at some point, indexed the contents of Unicode into Directory indexes, effectively breaking them down. Perhaps this was due to an old Plone error, or something wrong with add-on code or custom code.

You can try running full reindex with the default Python encoding for UTF-8 to get around this. The recommended procedure for production sites is not recommended ; this is just temporary β€œstucco” for your problem.

In your site-packages Python directory, add a file called sitecustomize.py with the contents:

 import sys sys.setdefaultencoding('utf8') 

then reload your Plone site and try renaming or running the full reindex directory.

Remember to delete the sitecustomize.py file sitecustomize.py . Setting the default encoding in Python will only mask future problems.

+5
source

All Articles