Package: dh-python
Version: 1.20131021-1
Severity: normal

Dear Maintainer,

I'm porting an existing package [0] to use “pybuild”. The build is failing
at the ‘dh_python2’ step:

=====
$ dh install --with python2,python3 --buildsystem=pybuild \
            --package python-coverage-dbg \
            --package python3-coverage-dbg
   dh_python2 -O--buildsystem=pybuild -O--package=python-coverage-dbg 
-O--package=python3-coverage-dbg
Traceback (most recent call last):
  File "/usr/share/dh-python/dh_python2", line 525, in <module>
    main()
  File "/usr/share/dh-python/dh_python2", line 358, in main
    rules = open('debian/rules', 'r').read()
  File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 54: 
ordinal not in range(128)
make: *** [install] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
E: Failed autobuilding of package
=====

This is because the ‘debian/rules’ content is encoded in UTF-8, but
‘dh_python2’ is incorrectly assuming ASCII:

=====
    # disable PyDist if dh_pydeb is used
    if options.guess_deps:
        try:
            rules = open('debian/rules', 'r').read()
        […]
=====

Debian Policy does not mention a content encoding for ‘debian/rules’, and
the GNU Make manual also does not mention it.

I was unable to construct a test case for ‘dh-python’ which exercises that
“guess_deps” option, so was not able to cause the error that way.

The expectation is that any encoding which satisfies GNU Make should also
be accepted when ‘dh-python’ accesses the ‘debian/rules’ file.


[0]: This is ‘python-coverage’, in a Bazaar branch for the migration work.
     Use ‘bzr branch --bind 
bzr+ssh://bzr.debian.org/bzr/collab-maint/python-coverage/pybuild/’
     to get the current packaging files for this migration.


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.12-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_AU.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dh-python depends on:
pn  python3:any  <none>

dh-python recommends no packages.

dh-python suggests no packages.

-- no debconf information

-- 
 \       “A computer once beat me at chess, but it was no match for me |
  `\                                     at kick boxing.” —Emo Philips |
_o__)                                                                  |
Ben Finney <b...@benfinney.id.au>

Attachment: signature.asc
Description: Digital signature

Reply via email to