Skip to content

Commit 6540a15

Browse files
committed
Set hidden _orig_filename directly and improve code comments
1 parent 205075e commit 6540a15

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Lib/zipfile/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,6 @@ class ZipInfo:
456456
)
457457

458458
def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)):
459-
self.orig_filename = None # Original file name in archive
460-
461459
# Terminate the file name at the first null byte and
462460
# ensure paths always use forward slashes as the directory separator.
463461
filename = _sanitize_filename(filename)
@@ -487,7 +485,11 @@ def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)):
487485
self.external_attr = 0 # External file attributes
488486
self.compress_size = 0 # Size of the compressed file
489487
self.file_size = 0 # Size of the uncompressed file
488+
489+
# Special internal attributes set by class ZipFile when read from an archive:
490+
self._orig_filename = None # Original file name in archive
490491
self._end_offset = None # Start of the next local header or central directory
492+
491493
# Other attributes are set by class ZipFile:
492494
# header_offset Byte offset to the file header
493495
# CRC CRC-32 of the uncompressed file

0 commit comments

Comments
 (0)