-
Notifications
You must be signed in to change notification settings - Fork 76
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
Fix UnicodeDecode errors when displaying the result page. #210
Fix UnicodeDecode errors when displaying the result page. #210
Conversation
@mauritsvanrees @smcmahon Could you please take a look at this? Travis failed at the 4.2 build with no reason apparent. The 4.1 and python 2.6 also fails, because of setuptools I guess... |
@smcmahon @mauritsvanrees sorry to bug you here but we really need to ship this fix to a client. We can fix and release on our own if we have permissions... |
I am looking into this now. I have meanwhile restarted the Travis build for 4.2, I did not see a log at all that I could look into. |
I have fixed the 4.2 build by pinning i18ndude to 4.3. See collective/buildout.plonetest#32. That should not have been the original error, because I only released the conflicting i18ndude 5 yesterday. But how do I reproduce the issue you are fixing? I added a LikertField, changed the last sample answer to The fix seems weird at first sight:
|
@mauritsvanrees The thing is that in the case of a Likert field, we are casting a dict (the content of the field) to str directly. Then it fails, because of the encoding. It's strange that worked for you. Here you can find where it's failing for me: |
Ah wait, I used a Thanks Page, and that does not use the template you fixed. |
@mauritsvanrees Mmm, regarding the implementation you're right, it fixes the dict use case, but it could fail if the field is str. |
Huh. Well, I see that on master this was already fixed in the same way in PR #200. |
I have released 1.7.24 with this fix. Thank you! cc @smcmahon |
Oh, great! Thanks! |
Thank you @mauritsvanrees! |
We experienced an issue on FormLikertFields in the result page when using unicode characters in the answers. It was caused because the result page is implicitly casting whatever it gets from the fields to str. I added an explicit cast and conversion to utf-8.
We need access to pypi for making a release as soon as possible. Please could you grant permissions to the "timo" pypi username?
Thanks!