-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MessageID broken for Python 3; produces byte domains which can't find utilities #17
Comments
It looks like the So it seems the simplest change will be to handle this in MessageID, and use |
jamadden
added a commit
to zopefoundation/zope.app.form
that referenced
this issue
Apr 26, 2017
clrpackages
pushed a commit
to clearlinux-pkgs/zope.configuration
that referenced
this issue
Dec 12, 2017
…o version 4.1.0 Adam Groszer (1): update bootstrap.py Felix Yan (2): Note explicit support for Python 3.5 Use shields.io for PyPI badge Jan-Jaap Driessen (4): Python3 support for printing ConfigurationExecutionError Add swp file to ignore list. Test for py3 support in ConfigurationConflictError. Merge pull request #14 from zopefoundation/resurrection-python3 Jason Madden (5): Make MessageID decode a bytes domain. whitespace [skip ci] Merge pull request #18 from zopefoundation/issue17 Wheels are universal Preparing release 4.1.0 Marius Gedminas (8): Update to latest bootstrap.py Merge pull request #1 from bunyk/patch-1 Make sure MANIFEST.in is complete Switch basepython to 2.7 for docs and coverage Merge pull request #11 from felixonmars/master Mention 3.5 in the changelog Merge pull request #12 from felixonmars/master Claim support for Python 3.6 Michael Howitz (3): Point to the repos. Point to the canonical URL Use the new TLD of RTD. Taras (1): Fix docstring for processxmlfile Tres Seaver (22): svb Speed up Travis start via 'sudo: false'. Update to latest bootstrap. Add Travis badge, garden ReST. Bow to our new PEP 440 overlords. Update hacking docs to point to Github. Remove no-longer true mention of building docs in buildout. Edit myself out in favor of J. Random Hacker. Remove SVN fossil Silence Sphinx warning. Add RTD dependency. Add PyPI and RTD badges. Silence setuptools faux warnings. Tox cleanups: Add explicit support for Python 3.4 on Travis. Drop support for Python 2.6 and 3.2. Merge pull request #13 from zopefoundation/drop-py26-py32-support Remove commented-out mention of py32 environment. Use stdlib's 'assertRaises'. 'assertTrue(foo in bar)'->'assertIn(foo, bar)'. 'assertTrue(isinstance(foo, Bar)'->'assertIsInstance(foo, Bar)'. Merge pull request #15 from zopefoundation/use-stdlib-assertRaises 4.1.0 (2017-04-26) ------------------ - Drop support for Python 2.6 and 3.2. - Add support for Python 3.5 and 3.6. - Fix the ``domain`` of MessageID fields to be a native string. Previously on Python 3 they were bytes, which meant that they couldn't be used to find translation utilities registered by zope.i18n. See `issue 17 <https://github.com/zopefoundation/zope.configuration/issues/17>`_.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As discovered in zope.app.form, when reading a MessageID field out of a ZCML file, the
domain
will be abyte
string under Python 3 (e.g.,b'zope'
). Butzope.i18n
registers ITranslationDomain utilities with normalstr
names. Since no byte string can ever equal astr
on Python 3, the utilities will never be found and translation will not happen.It seems to me that either MessageID should ensure that the domain is a
str
(decoding from...utf-8?) or the context itself could ensure that itsi18n_domain
is astr
. I think I like the latter better.The text was updated successfully, but these errors were encountered: