Skip to content

chore: get update-gyp.py to work with Python >= v3.5 - #2826

Merged
cclauss merged 2 commits into
nodejs:mainfrom
rzhao271:rzhao271/fix-update-script
Apr 6, 2023
Merged

cclauss merged 2 commits into
nodejs:mainfrom
rzhao271:rzhao271/fix-update-script

Conversation

@rzhao271

@rzhao271 rzhao271 commented Apr 6, 2023

Copy link
Copy Markdown
Contributor
Checklist
  • npm install && npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

numeric_owner is a keyword-only argument in Python v3.9. When I try running the script without the change, Python gives me the following error:

Unzipping...
Traceback (most recent call last):
  File "C:\Users\raymondzhao\work\node-gyp\update-gyp.py", line 54, in <module>
    safe_extract(tar_ref, unzip_target)
  File "C:\Users\raymondzhao\work\node-gyp\update-gyp.py", line 52, in safe_extract
    tar.extractall(path, members, numeric_owner)
TypeError: extractall() takes from 1 to 3 positional arguments but 4 were given

@cclauss cclauss changed the title chore: get update-gyp.py to work with Python v3.9 chore: get update-gyp.py to work with Python >= v3.5 Apr 6, 2023

@cclauss cclauss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! numeric_owner was added as a keyword-only argument tar.extractall() in Python 3.5.

@cclauss
cclauss merged commit 337e8e6 into nodejs:main Apr 6, 2023
@rzhao271
rzhao271 deleted the rzhao271/fix-update-script branch April 6, 2023 19:45
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.

2 participants