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

Fix 'gbk' codec can't encode character '\u200b' when resolve context #1508

Merged

Conversation

loonghao
Copy link
Contributor

@loonghao loonghao commented Jul 9, 2023

This PR is try to fix #1507

@loonghao loonghao requested review from nerdvegas and a team as code owners July 9, 2023 10:17
@loonghao loonghao changed the title fix 'gbk' codec can't encode character '\u200b' when resolve context Fix 'gbk' codec can't encode character '\u200b' when resolve context Jul 9, 2023
@maxnbk
Copy link
Contributor

maxnbk commented Jul 10, 2023

The io.open / codecs switch causes the py2.7 tests to fail, presently. Could that be wrapped per version?

Something like?

from rez.vendor.six import six

# http://python3porting.com/problems.html#replacing-userdict
if six.PY2:
    import codecs.open as open
else:
    import io.open as open

# [...]

with open() # etc

@loonghao
Copy link
Contributor Author

loonghao commented Jul 11, 2023

The io.open / codecs switch causes the py2.7 tests to fail, presently. Could that be wrapped per version?

Something like?

from rez.vendor.six import six

# http://python3porting.com/problems.html#replacing-userdict
if six.PY2:
    import codecs.open as open
else:
    import io.open as open

# [...]

with open() # etc

Test failed in CI same with this issues#1502

io.open should also work well in python-2.7, please let me know if there is anything else I missed, thanks.

Reference: https://code.activestate.com/lists/python-list/681909

I see the CI logs:
https://github.com/AcademySoftwareFoundation/rez/actions/runs/5499309914/jobs/10021427753?pr=1508#step:5:10110

@maxnbk I will update the MR, Thanks.

Signed-off-by: loonghao <hal.long@outlook.com>
@loonghao
Copy link
Contributor Author

@maxnbk I have already updated the PR. Please take your time to review it again and let me know if there is anything else that needs to be modified. Thank you.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@maxnbk maxnbk added this to the Next milestone Sep 6, 2023
@JeanChristopheMorinPerso JeanChristopheMorinPerso merged commit 1fd1c58 into AcademySoftwareFoundation:master Sep 9, 2023
@JeanChristopheMorinPerso
Copy link
Member

Thank you @loonghao ! We merged your change and it should be released in the next release.

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

Successfully merging this pull request may close these issues.

'gbk' codec can't encode character '\u200b' when resolve context
3 participants