Nir Soffer has posted comments on this change.

Change subject: startup: Change system default encoding to utf8
......................................................................


Patch Set 4:

(3 comments)

https://gerrit.ovirt.org/#/c/48661/4//COMMIT_MSG
Commit Message:

Line 5: CommitDate: 2015-11-17 15:57:54 +0200
Line 6: 
Line 7: startup: Change system default encoding to utf8
Line 8: 
Line 9: In Python 2, the system default encoding is 'ascii'. This cause mixing
> ... causes ...
Thanks, fixed.
Line 10: of unicode and non-ascii strings (e.g. utf8 encoded) to fail with
Line 11: UnicodeDecodeError or UnicodeEncodeError. The trigger for this failures
Line 12: is starting using the built-in json library, that return all values as
Line 13: unicode strings, even if the value is ascii.


Line 8: 
Line 9: In Python 2, the system default encoding is 'ascii'. This cause mixing
Line 10: of unicode and non-ascii strings (e.g. utf8 encoded) to fail with
Line 11: UnicodeDecodeError or UnicodeEncodeError. The trigger for this failures
Line 12: is starting using the built-in json library, that return all values as
> ... returns ...
Thanks, fixed.
Line 13: unicode strings, even if the value is ascii.
Line 14: 
Line 15: For example:
Line 16: 


Line 19:   File "<stdin>", line 1, in <module>
Line 20: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 
0: ordinal
Line 21: not in range(128)
Line 22: 
Line 23: Python tries to decode the second value implicitly, and fail since this
> ... fails ...
Thanks, fixed.
Line 24: is a utf8 encoded string.
Line 25: 
Line 26: To avoid such issues, the entire application must be changed to use 
only
Line 27: strings or only unicode internally, and never mix these types.  In the


-- 
To view, visit https://gerrit.ovirt.org/48661
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icc3f072a499ba4034bdbedd09eb60d7a3a32f9c8
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to