Skip to content

Fix: Fixed issue where 7z archive files could not be previewed or compressed #17426

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

Merged
merged 5 commits into from
Aug 10, 2025

Conversation

NicholasChin28
Copy link
Contributor

@NicholasChin28 NicholasChin28 commented Aug 9, 2025

Resolved / Related Issues

Steps used to test these changes

  1. Trace the logic of 7z archive compression by Right-clicking the mouse and selecting "Create xxx.7z" under the "Compress" option in the context menu.
  2. Upon step debugging, found out that adding the custom parameter cu was throwing an exception from the file with the error of System.ArgumentException: Value does not fall within the expected range
  3. After applying the fixes, compress multiple files by selecting Create xxx.7z under the Compress option in the context menu and then extract the created 7z archive.

Fix Description

  • Upon checking the documentation from the site, I noticed that the 7z archive does not contain the parameter cu.
  • I assume this could be the one causing the issue as when I tested without the cu archive, the bug reported by the original poster is fixed.
  • I also checked the .chm file from my downloaded 7zip instance. The version is 7-Zip 24.09 (x64)

@Josh65-2201
Copy link
Member

The CU code needed for zips for #17026

@yaira2
Copy link
Member

yaira2 commented Aug 10, 2025

The CU code needed for zips for #17026

Can it be made conditional?

- Only add "cu" parameter if not 7z archive format

Fixes files-community#17257
@NicholasChin28
Copy link
Contributor Author

Updated the code to exclude adding the parameter if its 7z archive

yaira2
yaira2 previously approved these changes Aug 10, 2025
@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Aug 10, 2025
@yaira2 yaira2 changed the title Fix: Unable to compress/preview 7z archive files Fix: Fixed issue where 7z archive files could not be previewed or compressed Aug 10, 2025
Added comment to link to GitHub issue

Fixes files-community#17257
Updated comment with description of GitHub issue

Fixes files-community#17257
yaira2
yaira2 previously approved these changes Aug 10, 2025
@yaira2 yaira2 merged commit 333577c into files-community:main Aug 10, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Unable to compress/preview 7z archive files.
3 participants