<div dir="ltr">It looks like this is a pip and setuptools bug. I was only able to reproduce by running "pip install ." in the package directory, in which case 'remover-0.0.0-py2.7.egg-info/installed-files.txt' contains<br><br>../../share/plugins <br>dependency_links.txt <br>PKG-INFO <br>SOURCES.txt <br>top_level.txt<div><br></div><div>Installing in this way pip has invoked 'setup.py install' for us. Uninstall will remove share/plugins and its contents but not share.<br><div><br></div><div>However running 'setup.py bdist_wheel' and then installing said wheel leaves no record of '../share/plugins' in 'remover-0.0.0.dist-info/RECORD'.</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jun 20, 2016 at 12:56 PM Sylvain Corlay <<a href="mailto:sylvain.corlay@gmail.com">sylvain.corlay@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">FYI, this could probably be a security issue with wheel: a wheel package that has an empty list of data files in any important subdirectory of sys.prefix can delete all the content of that directory upon uninstall or update.<div><br></div><div>Thanks,<br><div><br></div><div>Sylvain</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 15, 2016 at 11:30 AM, Sylvain Corlay <span dir="ltr"><<a href="mailto:sylvain.corlay@gmail.com" target="_blank">sylvain.corlay@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I discovered a quite serious bug in wheels (<a href="http://bugs.python.org/issue27317" target="_blank">http://bugs.python.org/issue27317</a>)<br><br>When specifying an empty list for the list of data_files in a given directory, the entire directory is being deleted on uninstall of the wheel, even if it contained other resources from other pacakges.<br><br>Example:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">from setuptools import setup<br></font><font face="monospace, monospace">setup(name='remover', data_files=[('share/plugins', [])])</font></blockquote><br>The expected behavior is that only the specified list of files is removed, (which is empty in that case).<br><br>When the list is not empty, the behavior is the one expected. For example,<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">from setuptools import setup<br></font><font face="monospace, monospace">setup(name='remover', data_files=[('share/plugins', ['foobar.json'])])</font></blockquote><br>will only remove `foobar.json` on uninstall and the `plugins` directory will not be removed if it is not empty.<br><br>Thanks,<br><br>Sylvain</div>
</blockquote></div><br></div>
_______________________________________________<br>
Distutils-SIG maillist  -  <a href="mailto:Distutils-SIG@python.org" target="_blank">Distutils-SIG@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/distutils-sig" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/distutils-sig</a><br>
</blockquote></div>