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

TypeError: a bytes-like object is required, not 'str' #209

Open
frapell opened this issue Jul 29, 2022 · 2 comments
Open

TypeError: a bytes-like object is required, not 'str' #209

frapell opened this issue Jul 29, 2022 · 2 comments

Comments

@frapell
Copy link
Member

frapell commented Jul 29, 2022

When on Python 3 with Zope 5.1 or 5.2 (This issue is fixed on Zope 5.3 and up), you get

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 167, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 376, in publish_module
  Module ZPublisher.WSGIPublisher, line 271, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 68, in call_object
  Module plone.app.theming.browser.controlpanel, line 73, in __call__
  Module plone.app.theming.browser.controlpanel, line 191, in update
TypeError: a bytes-like object is required, not 'str'

When trying to save custom styles from /@@theming-controlpanel -> Advanced Settings -> Custom Styles

To reproduce:

  1. Have a Plone 5 instance with Python 3, using Zope 5.1 or 5.2
  2. Visit /@@theming-controlpanel and add some Parameter expressions under Advanced settings -> Theme details, for instance
url = context/absolute_url
portal_url = portal_state/portal_url
  1. Go to Custom Styles and try to save some custom CSS, for instance
body{
color:red;
}
  1. Click Save
@mauritsvanrees
Copy link
Member

I can have a look later. But one thing jumps out:

Have a Plone 5 instance with Python 3, using Zope 5.1 or 5.2

This is not supported. Plone 5 only works with Zope 4. Or at least it is only tested with Zope 4. I would not recommend using a higher Zope version.

@frapell
Copy link
Member Author

frapell commented Aug 5, 2022

Yeah... I don't quite remember why we went to Zope 5 honestly... But we haven't had any issues (except this :P) Is there any specific concern it comes to your mind about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants