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

:lines converter converting to list of bytes instead of list of str #638

Closed
zopyx opened this issue May 22, 2019 · 5 comments · May be fixed by #648
Closed

:lines converter converting to list of bytes instead of list of str #638

zopyx opened this issue May 22, 2019 · 5 comments · May be fixed by #648
Labels

Comments

@zopyx
Copy link
Member

zopyx commented May 22, 2019

An textarea like

<textarea name="mytext:lines">
..
</textarea>

is converted by the new ZPublisher in Zope 4/Python 3 to list of byte strings instead of list of str.

This is inconsistent with the default behavior of <input type="text"> being returned as strinsiderequest.form`.

I think you could specify the encoding in older Zope versions like name="mytext:lines:unicode"> or name=mytext:lines:utf8 however the specifying an encoding does not make a difference.

@zopyx zopyx added the question label May 22, 2019
@jugmac00
Copy link
Member

jugmac00 commented May 22, 2019

seems to be related to #558

You could and possible should use ulines instead of lines.

And here is the pr which turned it into bytes - by consensus:
#206

Also, the documentation has to checked once again.
https://zope.readthedocs.io/en/latest/zdgbook/ObjectPublishing.html#argument-conversion

The "convert to native strings" for "lines" is obviously wrong - unlike most of the others, especially "tokens" which really return a list of "native strings". I'd say this is an inconsistency.

@tseaver
Copy link
Member

tseaver commented May 22, 2019

FWIW, my memory says ulines was how you specified that you really wanted a sequence of text, rather than bytes.

@zopyx
Copy link
Member Author

zopyx commented May 22, 2019

You are possibly right...have to check this in our own enviroment

@d-maurer
Copy link
Contributor

d-maurer commented May 23, 2019 via email

@d-maurer
Copy link
Contributor

This is fixed in Zope 5.9.x.

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

Successfully merging a pull request may close this issue.

4 participants