This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Micheal Gardner
Recipients Micheal Gardner
Date 2018-06-29.01:04:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1530234257.65.0.56676864532.issue33993@psf.upfronthosting.co.za>
In-reply-to
Content
when i want to zip a empty folder, i use following code

```

import zipfile

zfile = zipfile.ZipFile("tmp.zip",'w')
zif = zipfile.ZipInfo("tmp/")
zfile.writestr(zif,"")
zfile.close()
```

but in this case, things become weird.

```
# 先造一个测试文件夹
mkdir /tmp/test_folder/
touch /tmp/test_folder/test.md
```

```
import zipfile
file_path = "/tmp/test_folder/test.md"
rel_name = "test.md"
zfile = zipfile.ZipFile("tmp.zip",'w')
zif = zipfile.ZipInfo("tmp/")
zfile.writestr(zif,"")
zfile.write(file_path, rel_name)
zfile.close()
```

decompression expect 

```
$ tree tmp
tmp
├── test.md

1 file
```

decompression actual

```
$ tree tmp
tmp
├── test.md
└── tmp

1 directory, 1 file
```
History
Date User Action Args
2018-06-29 01:04:17Micheal Gardnersetrecipients: + Micheal Gardner
2018-06-29 01:04:17Micheal Gardnersetmessageid: <1530234257.65.0.56676864532.issue33993@psf.upfronthosting.co.za>
2018-06-29 01:04:17Micheal Gardnerlinkissue33993 messages
2018-06-29 01:04:16Micheal Gardnercreate