-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update/Fixup string encoding to for Python3 and fix UTF-8 for Python2 too #28
Merged
bernhardkaindl
merged 8 commits into
xapi-project:master
from
xenserver-next:fixup-str-encoding-for-py2+py3
Dec 8, 2023
Merged
Update/Fixup string encoding to for Python3 and fix UTF-8 for Python2 too #28
bernhardkaindl
merged 8 commits into
xapi-project:master
from
xenserver-next:fixup-str-encoding-for-py2+py3
Dec 8, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'unicode' is not available in python3, so remove the use of it. And for python3 'bytes' string might need to be converted to a regular string Signed-off-by: Qin Zhang (张琴) <[email protected]>
Signed-off-by: Bernhard Kaindl <[email protected]>
Note by Bernhard: As per the agreement with Andrew in xapi-project#18, we shall keep master py2-compatible and py3-only changes go to a py3 branch: Andrew wrote: > However, master needs to remain atomically py2 or py3 compatible, > and not a mix of fixes which leaves it broken in both. [...] > please keep all commits which break compatibility with py2 in a > separate single PR so it can be merged all in one go. > The final commit on the py3 branch should [...] Reference: xapi-project#18 (comment) Therefore, I'll squash this commit with the next commit for fixing it up keep master py2-compatible, at least until all py3 checks and a complete manual test was done by QA. Original commit message by Qin Zhang (张琴): Remove the use of 'encode' as it's used to turn a Unicode string into a regular string in Python2 Final Remarks by Bernhard, for completeleness: - This commit also adds conversion from curses input bytes to str. - Rebased to apply on the current master branch. Co-authored-by: Bernhard Kaindl <[email protected]> Signed-off-by: Qin Zhang (张琴) <[email protected]>
Signed-off-by: Bernhard Kaindl <[email protected]>
Signed-off-by: Bernhard Kaindl <[email protected]>
edwintorok
reviewed
Dec 7, 2023
Signed-off-by: Bernhard Kaindl <[email protected]>
Signed-off-by: Bernhard Kaindl <[email protected]>
bernhardkaindl
changed the title
Update/Fixup string encoding to for Python3 while not breaking Python2
Update/Fixup string encoding to for Python3 and fix UTF-8 for Python2 too
Dec 8, 2023
bernhardkaindl
force-pushed
the
fixup-str-encoding-for-py2+py3
branch
from
December 8, 2023 14:46
f915d90
to
2663d3b
Compare
Signed-off-by: Bernhard Kaindl <[email protected]>
bernhardkaindl
force-pushed
the
fixup-str-encoding-for-py2+py3
branch
from
December 8, 2023 14:47
2663d3b
to
0496a3b
Compare
Testcase for convert_anything_to_str() added, and international chars are working in Python2 now! |
edwintorok
approved these changes
Dec 8, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
GeraldEV
approved these changes
Dec 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update/Fixup string encoding to for Python3 while not breaking Python2
Tested as the first commit which keeps Python2 working, while have (seemingly) working Python3
Status:
pylint --py3k
has 3 TODOs left to fix, but this is the first version which works for Python3 as well! 🥇Use the
Files
tab for the review which squashes the commits, or just review commit 2 and commit 4 (links below):-> Commit 2 and 4 fully override commit 1 and 3, so they cancel/replace commit 1 and 3.
Commit 1: Remove the use of '
unicode
'Commit 2: Fixup commit 1: Update commit "Remove the use of 'unicode'" to unbreak Python2
Commit 3: Py3-only: Change str encoding from Python2 to only support Python3
Commit 4: Fixup commit 3: Update commit Py3-only: Change str encoding to unbreak Python2
Commit 5: Remove 'unicode-builtin' from the pylint --py3k TODO list