[Bug] CompressionType.None should be supported for uncompressed 7z files #700

Open
opened 2026-01-29 22:16:07 +00:00 by claunia · 0 comments
Owner

Originally created by @arcastro on GitHub (Sep 23, 2025).

Originally assigned to: @Copilot on GitHub.

What is the bug?

Uncompressed files within 7z archives already seem to be supported, in that they already "extract" correctly.
However, when reading the CompressionType field within the Entry, it currently throws an InvalidFormatException

Proposed Solution

I believe the fix should be simple enough.
Within the following block,

45de87cb97/src/SharpCompress/Common/SevenZip/SevenZipFilePart.cs (L70-L90)

We could add:

private const uint K_COPY = 0x0;

and

K_COPY => CompressionType.None, 

If you agree, I'd be happy to open a pull-request, but I figured I'd open an issue first, in case you have different thoughts.

Originally created by @arcastro on GitHub (Sep 23, 2025). Originally assigned to: @Copilot on GitHub. # What is the bug? Uncompressed files within 7z archives already seem to be supported, in that they already "extract" correctly. However, when reading the CompressionType field within the Entry, it currently throws an **InvalidFormatException** # Proposed Solution I believe the fix should be simple enough. Within the following block, https://github.com/adamhathcock/sharpcompress/blob/45de87cb97ad146a6abf7c66ef65e4226953a00e/src/SharpCompress/Common/SevenZip/SevenZipFilePart.cs#L70-L90 We could add: ```csharp private const uint K_COPY = 0x0; ``` and ```csharp K_COPY => CompressionType.None, ``` ----- If you agree, I'd be happy to open a pull-request, but I figured I'd open an issue first, in case you have different thoughts.
claunia added the bugup for grabs labels 2026-01-29 22:16:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#700