Skip to content

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

Closed
cclauss wants to merge 3 commits into
nodejs:masterfrom
cclauss:py3-icutrim.py
Closed

tools: fix Python 3 issues in tools/icu/icutrim.py#29213
cclauss wants to merge 3 commits into
nodejs:masterfrom
cclauss:py3-icutrim.py

Conversation

@cclauss

Copy link
Copy Markdown
Contributor

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-botnodejs-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

@srl295srl295 left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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

Did I miss something related to Python 2?

@srl295

Copy link
Copy Markdown
Member

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

@cclauss

Copy link
Copy Markdown
ContributorAuthor

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

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

@cclausscclauss added the python PRs and issues that require attention from people who are familiar with Python. label Aug 19, 2019
Comment threadtools/icu/icutrim.py Outdated
if options.locales:
config["variables"] = config.get("variables", {})
config["variables"]["locales"] = config["variables"].get("locales", {})
config["variables"]["locales"]["only"] = options.locales.split(',')

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Collaborator

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Trott pushed a commit that referenced this pull request Aug 21, 2019
PR-URL: #29213
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@Trott

Copy link
Copy Markdown
Member

Landed in d937b02

@TrottTrott 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 <srloomis@us.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@BridgeARBridgeAR mentioned this pull request Sep 3, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n-apiIssues and PRs related to the i18n implementation.pythonPRs and issues that require attention from people who are familiar with Python.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@cclauss@srl295@nodejs-github-bot@Trott@bnoordhuis@gengjiawen