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

doc: Minor fix on ICU maintenance, and fix in autogenerated readme #32347

Closed
wants to merge 0 commits into from

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Mar 18, 2020

  • Docs used the word "copy" when it really meant a tool is needed.

  • README-FULL-ICU.txt was generated in binary mode, but it's a
    text file. This breaks on Python3 for maintaining ICU

  • The ICU downloader was broken (also probably python3). It's
    basically dead code since 1a25e90
    landed (full icu in repo), unless someone deleted the deps/icu-small
    directory from their repo.

  • For that matter, small-icu (icutrim) was also broken on python3,
    it was not excluding what it ought to, so 'small' was about 9M instead
    of 3M.
    Fixed in fix #31650 right use of string and bytes objects #31659

  • documentation is changed or added

  • commit message follows commit guidelines

@srl295 srl295 added the i18n-api Issues and PRs related to the i18n implementation. label Mar 18, 2020
@srl295 srl295 self-assigned this Mar 18, 2020
@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Mar 18, 2020
@srl295 srl295 requested a review from richardlau March 18, 2020 18:31
@srl295
Copy link
Member Author

srl295 commented Mar 18, 2020

Drafting this because I'll work on an ICU 66.1 update and might hit something else

@srl295
Copy link
Member Author

srl295 commented Mar 18, 2020

OK, I remember what the python fix is for: python3. works in python2, but 3 says:

srl@pinguino:~/src/node$ python tools/icu/shrink-icu-src.py
Deleting existing icudst deps/icu-small
Data file root: icudt66l
will use datafile deps/icu/source/data/in/icudt66l.dat
deps/icu --> deps/icu-small
27M     deps/icu/source/data/in/icudt66l.dat
deps/icu/source/data/in/icudt66l.dat --compress-> deps/icu-small/source/data/in/icudt66l.dat.bz2
9M      deps/icu-small/source/data/in/icudt66l.dat.bz2
Traceback (most recent call last):
  File "tools/icu/shrink-icu-src.py", line 132, in <module>
    print("ICU sources - auto generated by shrink-icu-src.py", file=fi)
TypeError: a bytes-like object is required, not 'str'

@srl295 srl295 marked this pull request as ready for review March 18, 2020 19:40
@srl295 srl295 mentioned this pull request Mar 18, 2020
@srl295 srl295 requested review from devsnek and ryzokuken March 18, 2020 20:19
@srl295
Copy link
Member Author

srl295 commented Mar 18, 2020

By 'dead code' I mean the configure logic to automatically download ICU, because it's already there unless you delete deps/icu-small. We should keep the downloader itself, because it is needed for the --with-icu-source=https://github… option.

But the embedded download URL, and its md5 hash, and the logic for verifying the download, doesn't seem needed anymore.

@richardlau
Copy link
Member

cc @nodejs/python

@@ -63,7 +63,7 @@ def checkHash(targetfile, hashAlgo):
digest = hashlib.new(hashAlgo)
with open(targetfile, 'rb') as f:
chunk = f.read(1024)
while chunk != "":
while len(chunk) > 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just...

Suggested change
while len(chunk) > 0:
while chunk:

@cclauss
Copy link
Contributor

cclauss commented Mar 19, 2020

#31659 Landed which touched the same file. @bioinfornatics

@srl295
Copy link
Member Author

srl295 commented Mar 19, 2020

@cclauss @bioinfornatics the other fix works, so i removed icutrim from this PR…

@srl295 srl295 requested a review from cclauss March 19, 2020 01:18
tools/icu/shrink-icu-src.py Outdated Show resolved Hide resolved
@srl295 srl295 requested review from ryzokuken, jasnell and cclauss March 19, 2020 16:08
@srl295 srl295 added the python PRs and issues that require attention from people who are familiar with Python. label Mar 19, 2020
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@nodejs-github-bot
Copy link
Collaborator

@srl295
Copy link
Member Author

srl295 commented Mar 21, 2020

Landed in b8a794d

srl295 added a commit that referenced this pull request Mar 21, 2020
- Docs used the word "copy" when it really meant a tool is needed.
- README-FULL-ICU.txt was generated in binary mode, but it's a
text file. This breaks on Python3 for maintaining ICU
- The ICU downloader was broken (also probably python3). It's
basically dead code since 1a25e90
landed (full icu in repo), unless someone deleted the deps/icu-small
directory from their repo.

Co-Authored-By: Christian Clauss <[email protected]>
PR-URL: #32347

Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Christian Clauss <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@srl295 srl295 closed this Mar 21, 2020
@srl295 srl295 deleted the icu-docfix branch March 21, 2020 00:24
MylesBorins pushed a commit that referenced this pull request Mar 24, 2020
- Docs used the word "copy" when it really meant a tool is needed.
- README-FULL-ICU.txt was generated in binary mode, but it's a
text file. This breaks on Python3 for maintaining ICU
- The ICU downloader was broken (also probably python3). It's
basically dead code since 1a25e90
landed (full icu in repo), unless someone deleted the deps/icu-small
directory from their repo.

Co-Authored-By: Christian Clauss <[email protected]>
PR-URL: #32347

Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Christian Clauss <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Mar 24, 2020
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.

8 participants