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

tools: fix Python 3 issues in tools/icu/icutrim.py #29213

Closed
wants to merge 3 commits into from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Aug 19, 2019

Fix dict.has_key() and file encoding issues in tools/icu/icutrim.py to ensure compatibility with both Python 2 and Python 3.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added i18n-api Issues and PRs related to the i18n implementation. tools Issues and PRs related to the tools directory. labels Aug 19, 2019
Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I guess we are Python 3 only?

@cclauss
Copy link
Contributor Author

cclauss commented Aug 19, 2019

No. ensure compatibility with both Python 2 and Python 3.

Did I miss something related to Python 2?

@srl295
Copy link
Member

srl295 commented Aug 19, 2019

@cclauss OK, i see that there. I'm not familiar enough with the similarities I suppose.

@cclauss
Copy link
Contributor Author

cclauss commented Aug 19, 2019

https://docs.python.org/3/library/functions.html#print says:

print() cannot be used with binary mode file objects.

@cclauss cclauss added the python PRs and issues that require attention from people who are familiar with Python. label Aug 19, 2019
config["variables"]["locales"] = {}
if options.locales:
config["variables"] = config.get("variables", {})
config["variables"]["locales"] = config["variables"].get("locales", {})
config["variables"]["locales"]["only"] = options.locales.split(',')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file uses 4 space indent so can you use that here too?

(Confusing really since we use 2 space indent everywhere else. Oh well.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

Trott pushed a commit that referenced this pull request Aug 21, 2019
PR-URL: #29213
Reviewed-By: Steven R Loomis <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
@Trott
Copy link
Member

Trott commented Aug 21, 2019

Landed in d937b02

@Trott Trott closed this Aug 21, 2019
@cclauss cclauss deleted the py3-icutrim.py branch August 22, 2019 03:05
BridgeAR pushed a commit that referenced this pull request Sep 3, 2019
PR-URL: #29213
Reviewed-By: Steven R Loomis <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
@BridgeAR BridgeAR mentioned this pull request Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-api Issues and PRs related to the i18n implementation. python PRs and issues that require attention from people who are familiar with Python. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants