Return True if this archive member is a directory.
(self)
| 677 | return self |
| 678 | |
| 679 | def is_dir(self): |
| 680 | """Return True if this archive member is a directory.""" |
| 681 | if self.filename.endswith('/'): |
| 682 | return True |
| 683 | # The ZIP format specification requires to use forward slashes |
| 684 | # as the directory separator, but in practice some ZIP files |
| 685 | # created on Windows can use backward slashes. For compatibility |
| 686 | # with the extraction code which already handles this: |
| 687 | if os.path.altsep: |
| 688 | return self.filename.endswith((os.path.sep, os.path.altsep)) |
| 689 | return False |
| 690 | |
| 691 | |
| 692 | # ZIP encryption uses the CRC32 one-byte primitive for scrambling some |
no test coverage detected