★ wanayoo — archive 1999 https://github.com/nodejs/node/pull/32347Nouvelle recherche | Portail wanayoo
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 #31659

  • documentation is changed or added

  • commit message follows commit guidelines

@srl295 srl295 added the i18n-api label Mar 18, 2020
@srl295 srl295 self-assigned this Mar 18, 2020
@nodejs-github-bot nodejs-github-bot added the tools label Mar 18, 2020
@srl295 srl295 requested a review from richardlau Mar 18, 2020
@srl295
Copy link
Member Author

@srl295 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 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 Mar 18, 2020
@srl295 srl295 mentioned this pull request Mar 18, 2020
@srl295 srl295 requested review from devsnek and ryzokuken Mar 18, 2020
@srl295
Copy link
Member Author

@srl295 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

@richardlau richardlau commented Mar 18, 2020

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

@cclauss cclauss Mar 19, 2020

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 cclauss commented Mar 19, 2020

#31659 Landed which touched the same file. @bioinfornatics

@srl295
Copy link
Member Author

@srl295 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 Mar 19, 2020
tools/icu/shrink-icu-src.py Outdated Show resolved Hide resolved
tools/icu/shrink-icu-src.py Outdated Show resolved Hide resolved
@srl295 srl295 requested review from ryzokuken, jasnell and cclauss Mar 19, 2020
@srl295 srl295 added the python label Mar 19, 2020
Copy link
Member

@mhdawson mhdawson left a comment

LGTM

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Mar 19, 2020

@srl295
Copy link
Member Author

@srl295 srl295 commented Mar 21, 2020

Landed in b8a794d

srl295 added a commit that referenced this issue 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 <cclauss@me.com>
PR-URL: #32347

Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@srl295 srl295 closed this Mar 21, 2020
@srl295 srl295 deleted the icu-docfix branch Mar 21, 2020
MylesBorins added a commit that referenced this issue 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 <cclauss@me.com>
PR-URL: #32347

Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@MylesBorins MylesBorins mentioned this pull request Mar 24, 2020
@targos targos added dont-land-on-v10.x dont-land-on-v12.x labels Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont-land-on-v12.x i18n-api python tools
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants