multiarchive 0.2.3__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: multiarchive
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A high level archive handler for Python.
5
5
  Author: NSPC911
6
6
  Author-email: NSPC911 <87571998+NSPC911@users.noreply.github.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "multiarchive"
3
- version = "0.2.3"
3
+ version = "0.2.4"
4
4
  description = "A high level archive handler for Python."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "multiarchive"
3
- version = "0.2.3"
3
+ version = "0.2.4"
4
4
  description = "A high level archive handler for Python."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -257,7 +257,7 @@ class Archive:
257
257
  mode: File access mode ('r' for read, 'w' for write, 'a' for append)
258
258
  compression_level: Compression level (ZIP: 0-9, TAR gzip: 0-9, TAR bzip2: 1-9)
259
259
  If None, uses default compression
260
- pwd: Password for opening an encrypted file
260
+ pwd: Password for reading an encrypted ZIP file
261
261
  strict_timestamps: If True, reject timestamps outside the range supported
262
262
  by ZIP; if False, clamp them to the minimum or maximum supported value
263
263
 
@@ -296,7 +296,7 @@ class Archive:
296
296
  algo: Optional override for archive type based on file extension
297
297
  mode: File access mode ('r' for read, 'w' for write, 'a' for append)
298
298
  compression_level: Compression level (ZIP: 0-9, TAR gzip: 0-9, TAR bzip2: 1-9)
299
- pwd: Password for opening an encrypted file
299
+ pwd: Password for reading an encrypted ZIP file
300
300
  strict_timestamps: If True, reject timestamps outside the range supported
301
301
  by ZIP; if False, clamp them to the minimum or maximum supported value
302
302
 
@@ -487,6 +487,9 @@ class Archive:
487
487
  Raises:
488
488
  ValueError: If file extension is not recognized or compression_level is invalid
489
489
  """
490
+ if self.pwd is not None:
491
+ raise ValueError("Passwords are only supported when reading ZIP files")
492
+
490
493
  filename_lower = self.filename.lower()
491
494
 
492
495
  if (
@@ -772,7 +775,7 @@ class Archive:
772
775
 
773
776
  Args:
774
777
  member: Name of the file to open, or ZipInfo/TarInfo/RarInfo object
775
- mode: File open mode (only 'r' supported for non-TAR compressed and RAR files)
778
+ mode: File open mode (only 'r' supported for TAR and RAR files)
776
779
 
777
780
  Returns:
778
781
  File-like object for reading the member's contents, or None if member
File without changes