[Python-modules-team] Bug#904521: pypy-py: postinst uses /usr/share/doc content (Policy 12.3): /usr/share/doc/pypy-py/examples/genhtml.py

Simon McVittie smcv at debian.org
Wed Jul 25 09:04:24 BST 2018


Control: reassign -1 pypy
Control: affects -1 pypy-py

On Wed, 25 Jul 2018 at 03:09:51 +0200, Andreas Beckmann wrote:
> a test with piuparts revealed that your package uses files from
> /usr/share/doc in its maintainer scripts which is a violation of
> Policy 12.3: "Packages must not require the existence of any files in
> /usr/share/doc/ in order to function."
> https://www.debian.org/doc/debian-policy/#additional-documentation

This appears to be a bug in /usr/bin/pypycompile that is not present in
py3compile or pycompile: it fails if a file listed in the package cannot
be byte-compiled because it does not exist.

The attached source package is a nearly-minimal test case. To have more
clarity about what it's doing, the postinst and prerm are hard-coded
instead of being generated by dh_pywhatever, but I believe they're
equivalent to what dh_pywhatever would produce.

I can install the Python 2 and 3 versions successfully:

$ sudo dpkg --path-exclude='/usr/share/doc/*' -i ../python3-test904521_1_all.deb
Selecting previously unselected package python3-test904521.
(Reading database ... 448270 files and directories currently installed.)
Preparing to unpack .../python3-test904521_1_all.deb ...
Unpacking python3-test904521 (1) ...
Setting up python3-test904521 (1) ...

but not the pypy version:

$ sudo dpkg --path-exclude='/usr/share/doc/*' -i ../pypy-test904521_1_all.deb
Selecting previously unselected package pypy-test904521.
(Reading database ... 448288 files and directories currently installed.)
Preparing to unpack ../pypy-test904521_1_all.deb ...
Unpacking pypy-test904521 (1) ...
Setting up pypy-test904521 (1) ...
Traceback (most recent call last):
  File "/usr/bin/pypycompile", line 100, in <module>
    main()
  File "/usr/bin/pypycompile", line 93, in main
    py_compile.compile(module, doraise=True)
  File "/usr/lib/pypy/lib-python/2.7/py_compile.py", line 105, in compile
    with open(file, 'U') as f:
IOError: [Errno 2] No such file or directory: '/usr/share/doc/pypy-test904521/examples/test904521.py'
dpkg: error processing package pypy-test904521 (--install):
 installed pypy-test904521 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 pypy-test904521

> These files must be moved to /usr/share/$PACKAGE and may be symlinked
> from /usr/share/doc/$PACKAGE.

Since they seem to be only examples anyway, it would be a better solution
for them to be byte-compiled conditionally (if they exist) instead of
unconditionally, or not byte-compiled at all. I think addressing this in
pypy-py would just be working around a bug in pypycompile.

    smcv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test904521_1.tar.xz
Type: application/x-xz
Size: 1864 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20180725/13e077f2/attachment.xz>


More information about the Python-modules-team mailing list