Hi Martin Note: not opening a bug against release.debian.org yet. (I'm CC'ing the Release Team List and respective packages and Gregor, who too contributed on the patch needed for #682631). The debdiff unfortunately is not only related to #682631, but am I correct that all changes there should be in wheezy? I know not yet the 10 day testing period is over, but are you going to ask for an unblock for python-distutils-extra? I'm attaching the full debdiff which is currently found for the package in testing and the one in unstable. The fix would be needed to fix the FTBFS for linaro-image-tools and nautilus-image-manipulator in wheezy. Regards, Salvatore
Base version: python-distutils-extra_2.34-1 from testing Target version: python-distutils-extra_2.36-1 from unstable Hints in place: ==> kibi # 20120715 unblock python-distutils-extra/2.34-1 DistUtilsExtra/__init__.py | 2 +- DistUtilsExtra/auto.py | 17 ++++++++++++----- PKG-INFO | 2 +- debian/changelog | 24 ++++++++++++++++++++++++ debian/rules | 11 ++++++++--- python_distutils_extra.egg-info/PKG-INFO | 2 +- test/auto.py | 24 ++++++++++++++++++++++-- 7 files changed, 69 insertions(+), 13 deletions(-) diff -Nru python-distutils-extra-2.34/DistUtilsExtra/__init__.py python-distutils-extra-2.36/DistUtilsExtra/__init__.py --- python-distutils-extra-2.34/DistUtilsExtra/__init__.py 2012-06-26 05:32:53.000000000 +0000 +++ python-distutils-extra-2.36/DistUtilsExtra/__init__.py 2012-08-15 09:12:23.000000000 +0000 @@ -1 +1 @@ -__version__ = '2.34' +__version__ = '2.36' diff -Nru python-distutils-extra-2.34/DistUtilsExtra/auto.py python-distutils-extra-2.36/DistUtilsExtra/auto.py --- python-distutils-extra-2.34/DistUtilsExtra/auto.py 2012-07-09 09:11:21.000000000 +0000 +++ python-distutils-extra-2.36/DistUtilsExtra/auto.py 2012-08-15 09:14:16.000000000 +0000 @@ -39,7 +39,7 @@ # Author: Martin Pitt <martin.pitt@ubuntu.com> import os, os.path, fnmatch, stat, sys, subprocess -import ast +import ast, locale import distutils.core from functools import reduce @@ -101,8 +101,15 @@ if src: print('WARNING: the following files are not recognized by DistUtilsExtra.auto:') + enc = locale.getpreferredencoding() for f in sorted(src): - print (' ' + f) + # ensure that we can always print the file name + if(sys.version_info[0] < 3): + # hack to make this work with Python 2 + f_loc = f.decode('ascii', 'ignore') + else: + f_loc = f.encode(enc, errors='replace').decode(enc, errors='replace') + print (' ' + f_loc) # # parts of setup() @@ -380,7 +387,7 @@ with open(file, 'rb') as f: # send binary blob for python2, otherwise sending an unicode object with # "encoding" directive makes ast triggering an exception in python2 - if(sys.version_info.major < 3): + if(sys.version_info[0] < 3): file_content = f.read() else: file_content = f.read().decode('UTF-8') @@ -621,8 +628,8 @@ f_py = f + '.py' if os.access(f, os.X_OK) and os.path.splitext(f)[1] == '' and \ not os.path.exists(f_py): - line = open(f).readline() - if line.startswith('#!') and 'python' in line: + line = open(f, 'rb').readline() + if line.startswith(b'#!') and b'python' in line: os.symlink(os.path.basename(f), f_py) files.add(f_py) exe_symlinks.append(f_py) diff -Nru python-distutils-extra-2.34/PKG-INFO python-distutils-extra-2.36/PKG-INFO --- python-distutils-extra-2.34/PKG-INFO 2012-07-09 09:13:31.000000000 +0000 +++ python-distutils-extra-2.36/PKG-INFO 2012-08-15 09:20:06.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: python-distutils-extra -Version: 2.34 +Version: 2.36 Summary: Add support for i18n, documentation and icons to distutils Home-page: UNKNOWN Author: Sebastian Heinlein, Martin Pitt diff -Nru python-distutils-extra-2.34/debian/changelog python-distutils-extra-2.36/debian/changelog --- python-distutils-extra-2.34/debian/changelog 2012-07-09 09:14:25.000000000 +0000 +++ python-distutils-extra-2.36/debian/changelog 2012-08-15 09:23:31.000000000 +0000 @@ -1,3 +1,27 @@ +python-distutils-extra (2.36-1) unstable; urgency=low + + * debian/rules: Run tests against all supported python 2 and 3 versions. + This catches bugs with Python 2.6. (Closes: #684967) + * debian/rules: Skip tests if $DEB_BUILD_OPTIONS contains "nocheck". + (Closes: #684966) + * debian/rules: Run tests under LC_ALL=C, to fix FTBFS in cases where + LC_CTYPE is set explicitly. Thanks Gregor Hermann! + * auto.py: Use python 2.6 friendly sys.version_info test. Thanks Salvatore + Bonaccorso and Gregor Hermann! (First half of #682631) + * auto.py: Do not call decode() with an "errors" keyword, as this does not + yet work with Python 2.6. Thanks Gregor Hermann! (Closes: #682631) + + -- Martin Pitt <mpitt@debian.org> Wed, 15 Aug 2012 11:20:58 +0200 + +python-distutils-extra (2.35-1) unstable; urgency=low + + * auto.py: Fix printing of unrecognized non-ASCII file names under ASCII + locales. (LP: #1025031) + * auto.py: Fix detection of extensionless Python scripts with non-ASCII + characters in the first few lines. (LP: #1025022) + + -- Martin Pitt <mpitt@debian.org> Fri, 03 Aug 2012 13:56:14 +0200 + python-distutils-extra (2.34-1) unstable; urgency=low [ Martin Pitt ] diff -Nru python-distutils-extra-2.34/debian/rules python-distutils-extra-2.36/debian/rules --- python-distutils-extra-2.34/debian/rules 2012-07-09 09:14:25.000000000 +0000 +++ python-distutils-extra-2.36/debian/rules 2012-08-15 09:23:31.000000000 +0000 @@ -8,7 +8,6 @@ set -ex; for python in $(shell py3versions -r); do \ $$python setup.py build; \ done - test/auto.py -v override_dh_auto_install: dh_auto_install @@ -21,8 +20,14 @@ #install -D -m 755 debian/local/python-mkdebian debian/python3-distutils-extra/usr/bin/python3-mkdebian #sed -i 's,^#!/usr/bin/python,#!/usr/bin/python3,' debian/python3-distutils-extra/usr/bin/python3-mkdebian - # run tests with python3 - cd test; LC_ALL= LANGUAGE= LANG=C PYTHONPATH=`pwd`/../debian/python3-distutils-extra/usr/lib/python3/dist-packages/ python3 ./auto.py -v +override_dh_auto_test: +ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS))) + # run tests with all supported python 2 and 3 versions + set -e; for python in `pyversions -s` `py3versions -s`; do \ + echo "-- Running tests with $$python ----------------"; \ + LC_ALL=C LANGUAGE= LANG=C PYTHONPATH=. $$python test/auto.py -v; \ + done +endif override_dh_auto_clean: dh_auto_clean diff -Nru python-distutils-extra-2.34/python_distutils_extra.egg-info/PKG-INFO python-distutils-extra-2.36/python_distutils_extra.egg-info/PKG-INFO --- python-distutils-extra-2.34/python_distutils_extra.egg-info/PKG-INFO 2012-07-09 09:13:31.000000000 +0000 +++ python-distutils-extra-2.36/python_distutils_extra.egg-info/PKG-INFO 2012-08-15 09:20:06.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: python-distutils-extra -Version: 2.34 +Version: 2.36 Summary: Add support for i18n, documentation and icons to distutils Home-page: UNKNOWN Author: Sebastian Heinlein, Martin Pitt diff -Nru python-distutils-extra-2.34/test/auto.py python-distutils-extra-2.36/test/auto.py --- python-distutils-extra-2.34/test/auto.py 2012-07-09 09:10:26.000000000 +0000 +++ python-distutils-extra-2.36/test/auto.py 2012-07-18 13:16:37.000000000 +0000 @@ -373,13 +373,14 @@ # these should get autoinstalled self._mksrc('bin/yell', '#!/bin/sh', True) self._mksrc('bin/shout', '#!/bin/sh', True) - self._mksrc('bin/foo', '#!/bin/sh', True) + self._mksrc('bin/foo', b'#!/usr/bin/python\n# \xc2\xa9 copyright'.decode('UTF-8'), True) os.symlink('shout', os.path.join(self.src, 'bin', 'shoutlink')) # these shouldn't self._mksrc('daemon/food', '#!/bin/sh', True) # not in bin/ self._mksrc('foob', '#!/bin/sh', True) # not named like project - self._mksrc('bin/whisper', '#!/bin/sh') # not executable + # not executable + self._mksrc('bin/whisper', b'#!/usr/bin/python\n# \xc2\xa9 copyright'.decode('UTF-8')) (o, e, s) = self.do_install() self.assertEqual(e, '') @@ -814,7 +815,26 @@ f = self.installed_files() self.assertEqual(len(f), 1, f) self.assertTrue('egg-info' in f[0]) + + def test_utf8_filenames(self): + '''UTF-8 file names''' + bin_fname = b'a\xc3\xa4b.bin'.decode('UTF-8') + with open(os.path.join(self.src, bin_fname).encode('UTF-8'), 'wb') as f: + f.write(b'\x00\x01abc\xFF\xFE') + + (o, e, s) = self.do_install() + self.assertEqual(e, '') + self.assertEqual(s, 0) + + f = self.installed_files() + self.assertEqual(len(f), 1, f) + self.assertTrue('egg-info' in f[0]) + + self.assertTrue('following files are not recognized' in o) + # this might not be the correct file name when the locale is e. g. C + self.assertTrue('b.bin\n' in o, o) + # # helper methods # Hints needed: unblock python-distutils-extra/2.36-1
Attachment:
signature.asc
Description: Digital signature