Commit a7dea706 authored by Jérome Perrin's avatar Jérome Perrin

Revert "XXX-zope4py3: zodbpickle: Dirty hack to have encoding sets to utf-8."

This reverts commit 31eaaec1.

This slows down business template by a factor of two and it seems we
don't need it. I'm experimenting with hacks in ppml.py but maybe just
creating the Unpickler with encoding='utf-8' in
product/ERP5Type/XMLExportImport/__init__.py:267 is enough ?
parent 54425672
......@@ -47,7 +47,7 @@ eggs = ${ZODB:egg}
recipe = zc.recipe.egg:eggs
egg = ZODB
eggs = ${:egg}
depends = ${persistent:egg} ${BTrees:egg} ${zodbpickle:egg}
depends = ${persistent:egg} ${BTrees:egg}
[ZODB4]
<= _ZODB
......@@ -91,19 +91,12 @@ recipe = zc.recipe.egg:custom
egg = ${:_buildout_section_name_}
setup-eggs = ${python-cffi:egg}
[zodbpickle]
recipe = zc.recipe.egg:custom
egg = zodbpickle
patches =
${:_profile_base_location_}/../../component/egg-patch/zodbpickle/utf8-by-default.patch#bef23b1883d175e1238b9aaf38faaa7b
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
# eggs that are common to ZODB4 and ZODB5.
[versions]
BTrees = 4.11.3
persistent = 4.9.3
zodbpickle = 2.6.0+SlapOSPatched001
zodbpickle = 2.6.0
# Provide ZODB3 for those eggs that still care about ZODB3 compatibility -
# for example wendelin.core. ZODB3 3.11 is just a dependency egg on _latest_
......
--- a/src/zodbpickle/pickle_3.py 2022-05-04 17:14:14.001724804 +0000
+++ b/src/zodbpickle/pickle_3.py 2022-05-05 18:19:59.604856127 +0000
@@ -788,7 +788,7 @@
class _Unpickler:
def __init__(self, file, *, fix_imports=True,
- encoding="ASCII", errors="strict"):
+ encoding="utf-8", errors="strict"):
"""This takes a binary file for reading a pickle data stream.
The protocol version of the pickle is detected automatically, so no
@@ -1479,9 +1479,10 @@
encoding=encoding, errors=errors).load()
# Use the faster _pickle if possible
-try:
- from zodbpickle._pickle import *
-except ImportError:
+#try:
+# from zodbpickle._pickle import *
+#except ImportError:
+if 1:
Pickler, Unpickler = _Pickler, _Unpickler
dump, dumps, load, loads = _dump, _dumps, _load, _loads
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment