Skip to content
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

Page Templates: Non-ASCII ID breaks trying to assign a title #574

Closed
dataflake opened this issue Apr 28, 2019 · 0 comments

Comments

@dataflake
Copy link
Member

commented Apr 28, 2019

Creating a Page Template with a non-ASCII ID and default content works fine, and it renders without issue. It breaks inside title_and_id as soon as you add a title. This is on Python 2.

Traceback (most recent call last):
  File "/Users/jens/src/.eggs/waitress-1.2.1-py2.7.egg/waitress/channel.py", line 336, in service
    task.service()
  File "/Users/jens/src/.eggs/waitress-1.2.1-py2.7.egg/waitress/task.py", line 175, in service
    self.execute()
  File "/Users/jens/src/.eggs/waitress-1.2.1-py2.7.egg/waitress/task.py", line 452, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/Users/jens/src/zope/Zope/src/ZPublisher/httpexceptions.py", line 30, in __call__
    return self.application(environ, start_response)
  File "/Users/jens/src/.eggs/Paste-3.0.8-py2.7.egg/paste/translogger.py", line 69, in __call__
    return self.application(environ, replacement_start_response)
  File "/Users/jens/src/zope/Zope/src/ZPublisher/WSGIPublisher.py", line 296, in publish_module
    response = _publish(request, new_mod_info)
  File "/Users/jens/src/zope/Zope/src/ZPublisher/WSGIPublisher.py", line 230, in publish
    bind=1)
  File "/Users/jens/src/zope/Zope/src/ZPublisher/mapply.py", line 85, in mapply
    return debug(object, args, context)
  File "/Users/jens/src/zope/Zope/src/ZPublisher/WSGIPublisher.py", line 59, in call_object
    return obj(*args)
  File "/Users/jens/src/zope/Zope/src/Products/PageTemplates/ZopePageTemplate.py", line 170, in pt_editAction
    return self.pt_editForm(manage_tabs_message=message)
  File "/Users/jens/src/zope/Zope/src/Shared/DC/Scripts/Bindings.py", line 333, in __call__
    return self._bindAndExec(args, kw, None)
  File "/Users/jens/src/zope/Zope/src/Shared/DC/Scripts/Bindings.py", line 370, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/Users/jens/src/zope/Zope/src/Products/PageTemplates/PageTemplateFile.py", line 145, in _exec
    return self.pt_render(extra_context=bound_names)
  File "/Users/jens/src/zope/Zope/src/Products/PageTemplates/PageTemplate.py", line 85, in pt_render
    showtal=showtal)
  File "/Users/jens/src/.eggs/zope.pagetemplate-4.4.1-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 135, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations
  File "/Users/jens/src/zope/Zope/src/Products/PageTemplates/engine.py", line 88, in __call__
    return self.template.render(**kwargs)
  File "/Users/jens/src/.eggs/z3c.pt-3.2.0-py2.7.egg/z3c/pt/pagetemplate.py", line 173, in render
    return base_renderer(**context)
  File "/Users/jens/src/.eggs/Chameleon-3.6-py2.7.egg/chameleon/zpt/template.py", line 306, in render
    return super(PageTemplate, self).render(**_kw)
  File "/Users/jens/src/.eggs/Chameleon-3.6-py2.7.egg/chameleon/template.py", line 209, in render
    raise_with_traceback(exc, tb)
  File "/Users/jens/src/.eggs/Chameleon-3.6-py2.7.egg/chameleon/template.py", line 187, in render
    self._render(stream, econtext, rcontext)
  File "/Users/jens/src/buildout/zope4_py2/var/cache/56282459b5b7eb942db375efe89d6a36.py", line 849, in render
    __cache_4447208976 = _static_4444906960(getitem('context'), econtext, True, ('title_and_id', ))
  File "/Users/jens/src/zope/Zope/src/Products/PageTemplates/expression.py", line 81, in __call__
    base = render(base, econtext)
  File "/Users/jens/src/zope/Zope/src/Products/PageTemplates/Expressions.py", line 122, in render
    ob = ob()
  File "/Users/jens/src/zope/Zope/src/OFS/SimpleItem.py", line 191, in title_and_id
    return title and ("%s (%s)" % (title, id)) or id
UnicodeDecodeError: <unprintable UnicodeDecodeError object>

@dataflake dataflake added the bug label Apr 28, 2019

@dataflake dataflake added this to the 4.0 final milestone Apr 28, 2019

@dataflake dataflake added this to To do in Zope 4 final release via automation Apr 28, 2019

@dataflake dataflake closed this in 7f2933a Apr 29, 2019

Zope 4 final release automation moved this from To do to Done Apr 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1 participant
You can’t perform that action at this time.