Commit f0fd2194 authored by Alexandre Boeglin's avatar Alexandre Boeglin

iHotfix StringIO patch is now disabled by a ERP5Type patch

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18213 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent abee73a5
......@@ -75,26 +75,7 @@ ZopeTestCase.installProduct('MailHost', quiet=install_product_quiet)
ZopeTestCase.installProduct('PageTemplates', quiet=install_product_quiet)
ZopeTestCase.installProduct('PythonScripts', quiet=install_product_quiet)
ZopeTestCase.installProduct('ExternalMethod', quiet=install_product_quiet)
try:
# Workaround iHotFix patch that doesn't work with
# ZopeTestCase REQUESTs
ZopeTestCase.installProduct('iHotfix', quiet=install_product_quiet)
from Products import iHotfix
from types import UnicodeType
# revert monkey patchs from iHotfix
iHotfix.get_request = get_request
originalStringIO = iHotfix.originalStringIO
class UnicodeSafeStringIO(originalStringIO):
"""StringIO like class which never fails with unicode."""
def write(self, s):
if isinstance(s, UnicodeType):
s = s.encode('utf8', 'repr')
originalStringIO.write(self, s)
# iHotFix will patch PageTemplate StringIO with
iHotfix.iHotfixStringIO = UnicodeSafeStringIO
except ImportError:
pass
ZopeTestCase.installProduct('iHotfix', quiet=install_product_quiet)
ZopeTestCase.installProduct('Localizer', quiet=install_product_quiet)
ZopeTestCase.installProduct('TimerService', quiet=install_product_quiet)
......
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