[PR #931] [MERGED] Added ArgumentException to Archive.Open implementations #1355

Closed
opened 2026-01-29 22:20:09 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/931
Author: @SimonCahill
Created: 7/21/2025
Status: Merged
Merged: 7/22/2025
Merged by: @adamhathcock

Base: masterHead: feat/add-throw-on-unseekable-stream


📝 Commits (4)

  • a88390a Added ArgumentException which is thrown when a non-seekable Stream instance is passed
  • d810f8d Reverted back; I don't know how this file changed
  • c0ae319 Reverted debug change
  • 5bdd39e Merge branch 'master' into feat/add-throw-on-unseekable-stream

📊 Changes

6 files changed (+31 additions, -1 deletions)

View changed files

📝 src/SharpCompress/Archives/GZip/GZipArchive.cs (+6 -0)
📝 src/SharpCompress/Archives/Rar/RarArchive.cs (+6 -0)
📝 src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs (+6 -0)
📝 src/SharpCompress/Archives/Tar/TarArchive.cs (+6 -0)
📝 src/SharpCompress/Archives/Zip/ZipArchive.cs (+6 -0)
📝 src/SharpCompress/packages.lock.json (+1 -1)

📄 Description

This minor change affects the Open methods of each Archive type.

The change is only a condition, determining whether or not the Stream is seekable, and throws an ArgumentException if that's the case.

I'd though of implementing this, too, but @Morilli gave me the final motivation.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/931 **Author:** [@SimonCahill](https://github.com/SimonCahill) **Created:** 7/21/2025 **Status:** ✅ Merged **Merged:** 7/22/2025 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `feat/add-throw-on-unseekable-stream` --- ### 📝 Commits (4) - [`a88390a`](https://github.com/adamhathcock/sharpcompress/commit/a88390a546214af66c73e22ab5a24c41ee5273b4) Added ArgumentException which is thrown when a non-seekable Stream instance is passed - [`d810f8d`](https://github.com/adamhathcock/sharpcompress/commit/d810f8d8db145e99b72b02931e12b9162e923bf2) Reverted back; I don't know how this file changed - [`c0ae319`](https://github.com/adamhathcock/sharpcompress/commit/c0ae319c63fc27193f534d091221b20894f0faa7) Reverted debug change - [`5bdd39e`](https://github.com/adamhathcock/sharpcompress/commit/5bdd39e6eba33c01bc5f02fa007b5fea999a7e31) Merge branch 'master' into feat/add-throw-on-unseekable-stream ### 📊 Changes **6 files changed** (+31 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Archives/GZip/GZipArchive.cs` (+6 -0) 📝 `src/SharpCompress/Archives/Rar/RarArchive.cs` (+6 -0) 📝 `src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs` (+6 -0) 📝 `src/SharpCompress/Archives/Tar/TarArchive.cs` (+6 -0) 📝 `src/SharpCompress/Archives/Zip/ZipArchive.cs` (+6 -0) 📝 `src/SharpCompress/packages.lock.json` (+1 -1) </details> ### 📄 Description This minor change affects the `Open` methods of each Archive type. The change is only a condition, determining whether or not the `Stream` is seekable, and throws an `ArgumentException` if that's the case. I'd though of implementing this, too, but @Morilli gave me the final motivation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:20:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1355