Return True if this archive member is a directory.
(self)
| 558 | return zinfo |
| 559 | |
| 560 | def is_dir(self): |
| 561 | """Return True if this archive member is a directory.""" |
| 562 | if self.filename.endswith('/'): |
| 563 | return True |
| 564 | # The ZIP format specification requires to use forward slashes |
| 565 | # as the directory separator, but in practice some ZIP files |
| 566 | # created on Windows can use backward slashes. For compatibility |
| 567 | # with the extraction code which already handles this: |
| 568 | if os.path.altsep: |
| 569 | return self.filename.endswith((os.path.sep, os.path.altsep)) |
| 570 | return False |
| 571 | |
| 572 | |
| 573 | # ZIP encryption uses the CRC32 one-byte primitive for scrambling some |