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

Fix TypeError when using UPX compression #7998

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Fix TypeError when using UPX compression #7998

merged 1 commit into from
Oct 10, 2023

Conversation

sebthom
Copy link
Contributor

@sebthom sebthom commented Oct 9, 2023

This fixes TypeError: process_collected_binary() got an unexpected keyword argument 'strip' as of PyInstaller 6.0.0 when using UPX compression, because stripand upx parameters of process_collected_binary were renamed to use_strip and use_upx.

+ python -O -m PyInstaller pyinstaller.spec --clean
1281 INFO: PyInstaller: 6.0.0
1281 INFO: Python: 3.12.0
1313 INFO: Platform: Windows-2022Server-10.0.20348-SP0
1344 INFO: UPX is available and will be used if enabled on build targets.
...
27594 INFO: checking PKG
27594 INFO: Building PKG because PKG-00.toc is non existent
27594 INFO: Building PKG (CArchive) foo.pkg
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\__main__.py", line 209, in <module>
    run()
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\__main__.py", line 189, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\__main__.py", line 61, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\building\build_main.py", line 1033, in main
    build(specfile, distpath, workpath, clean_build)
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\building\build_main.py", line 973, in build
    exec(code, spec_namespace)
  File "pyinstaller.spec", line 66, in <module>
    exe = EXE(pyz,
          ^^^^^^^^
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\building\api.py", line 606, in __init__
    self.pkg = PKG(
               ^^^^
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\building\api.py", line 238, in __init__
    self.__postinit__()
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\building\datastruct.py", line 184, in __postinit__
    self.assemble()
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\building\api.py", line 289, in assemble
    src_name = process_collected_binary(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\foo\foo\.venv\Lib\site-packages\PyInstaller\building\utils.py", line 208, in process_collected_binary
    src_name = process_collected_binary(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: process_collected_binary() got an unexpected keyword argument 'strip'
Error: Process completed with exit code 1.

@sebthom
Copy link
Contributor Author

sebthom commented Oct 10, 2023

@rokm who else needs to approve for the build jobs to run?

@rokm
Copy link
Member

rokm commented Oct 10, 2023

@rokm who else needs to approve for the build jobs to run?

Nobody, because we won't need to run the jobs for this one. The PR itself is waiting for approval from @bwoodsend, though.

@bwoodsend
Copy link
Member

Yeah sorry, I saw this then forgot about it. Can we get a news entry. Looks good beyond that.

This fixes `TypeError: process_collected_binary() got an unexpected
keyword argument 'strip'` when using UPX compression, because
`strip` and `upx` parameters of `process_collected_binary` were
renamed to `use_strip` and `use_upx`.
@rokm
Copy link
Member

rokm commented Oct 10, 2023

I've taken the liberty of adding the news fragment.

@bwoodsend bwoodsend merged commit 89cb204 into pyinstaller:develop Oct 10, 2023
18 checks passed
@sebthom
Copy link
Contributor Author

sebthom commented Oct 12, 2023

@bwoodsend thanks a lot for merging the fix! I would appreciate a timely release as this is a blocker for our project. Is there any ETA for a 6.0.1 release?

@bwoodsend
Copy link
Member

I think I'll just make a 6.1.0 release early. Patch releases require branching, pruning out the feature changes then reassembling the changelog back into one straight line – not something I do when I can avoid it. People are also waiting for #7968 albeit not for particularity good reasons...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants