Skip to content

Commit

Permalink
Depend on zope.configuration 4.1 for the fix to zopefoundation/zope.c…
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Apr 26, 2017
1 parent f5ef128 commit ae821aa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def read(*rnames):
"zope.browserpage >= 3.10.1",
"zope.browsermenu",
"zope.component",
"zope.configuration",
"zope.configuration >= 4.1.0",
"zope.datetime",
"zope.exceptions",
"zope.i18n",
Expand Down
15 changes: 0 additions & 15 deletions src/zope/app/form/browser/metaconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,6 @@ def __init__(self, _context, **kwargs):
self._context = _context
for key, value in kwargs.items():
if not (value is None and hasattr(self, key)):
# zope.configuration.fields.MessageID gets the domain
# as a byte string But
# zope.i18n.zcml.registerTranslations
# (<i18n:registerTranslations>) registers
# ITranslationDomain objects with strs (what's
# returned from the filesystem) And on Python 3, bytes
# != str so the utilities can't be found. So we have
# to correct this if we want our translations to work.
# See https://github.com/zopefoundation/zope.configuration/issues/17
if (bytes is not str
and hasattr(value, 'domain')
and isinstance(value.domain, bytes)):
domain = value.domain.decode('ascii')
factory = zope.i18nmessageid.MessageFactory(domain)
value = factory(str(value), value.default)
setattr(self, key, value)
self._normalize()
self._widgets = {}
Expand Down

0 comments on commit ae821aa

Please sign in to comment.