Path: csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod From: Andreas Tille Newsgroups: linux.debian.maint.python Subject: Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties) Date: Mon, 15 Oct 2018 11:40:01 +0200 Message-ID: References: X-Mailbox-Line: From debian-python-request@lists.debian.org Mon Oct 15 09:37:54 2018 Old-Return-Path: X-Amavis-Spam-Status: No, score=-5.999 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DIGITS_LETTERS=1, LDO_WHITELIST=-5, RCVD_IN_DNSWL_NONE=-0.0001, WEIRD_PORT=0.001] autolearn=no autolearn_force=no X-Policyd-Weight: using cached result; rate:hard: -6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20170113 (1.7.2) X-Mailing-List: archive/latest/16434 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/20181015093737.wfrvaixo2bdmwvav@an3as.eu Approved: robomod@news.nic.it Lines: 95 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Mon, 15 Oct 2018 11:37:37 +0200 X-Original-Message-ID: <20181015093737.wfrvaixo2bdmwvav@an3as.eu> X-Original-References: <20181011110643.hrxkvpfyzj4jjqeb@an3as.eu> <20181012061902.mf7vngqnwvxdge2s@an3as.eu> <20181012111533.4ym6loirbvnr2fnx@an3as.eu> <1539343938.2065153.1539680744.792D0909@webmail.messagingengine.com> <20181012124426.37nixbp2qupadu4o@an3as.eu> <20181012141757.lpt5lmh4dhuzdsb3@an3as.eu> <20181012161900.q4eama42xml7ppo7@sar0.p1otr.com> Xref: csiph.com linux.debian.maint.python:11002 On Fri, Oct 12, 2018 at 06:19:00PM +0200, Piotr Ożarowski wrote: > [PICCA Frederic-Emmanuel, 2018-10-12] > > to my opinion, the code is modify in place with 2to3. > > So the code on the source after the configuration is already converted to python3. > > And during the build process, with python2 the code is copied as it in the .pybuild place for python2 > > with python3 we see that the RefactoringTool, does nothing, it means the code is already converted to python3. > > try adding python3-setuptools to Build-Depends To follow this hint I did: diff --git a/debian/control b/debian/control index c66846a..12dfd7d 100644 --- a/debian/control +++ b/debian/control @@ -10,10 +10,12 @@ Build-Depends: debhelper (>= 11~), python-all, python-nose, python-numpy, + python-setuptools, python3-sphinx, python3-all, python3-nose, python3-numpy, + python3-setuptools, 2to3 Standards-Version: 4.2.1 Vcs-Browser: https://salsa.debian.org/debian/python-uncertainties diff --git a/debian/rules b/debian/rules index 9a27f86..59d4cf5 100755 --- a/debian/rules +++ b/debian/rules @@ -17,14 +17,14 @@ override_dh_auto_build: dh_auto_build PYTHONPATH=`pybuild --print build_dir --interpreter python3` http_proxy='http://127.0.0.1:9/' sphinx-build -N -bhtml doc debian/html -override_dh_auto_test: +__override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) # for some very strange reason the RefactoringTool breaks the definions in TO_SUPERSCRIPT find . -name core.py -exec sed -i "s/^\([[:space:]]\+0x[0-9a-f]\{2\}: \)'/\1u'/" \{\} \; dh_auto_test || true # FIXME: Ignore errors for the moment but at least document these in logs endif -override_dh_auto_install: +__override_dh_auto_install: dh_auto_install # we need the same means as for the tests again before installing the files find debian -name core.py -exec sed -i "s/^\([[:space:]]\+0x[0-9a-f]\{2\}: \)'/\1u'/" \{\} \; which results in: PYTHONPATH=`pybuild --print build_dir --interpreter python3` http_proxy='http://127.0.0.1:9/' sphinx-build -N -bhtml doc debian/html Running Sphinx v1.7.9 Configuration error: There is a syntax error in your configuration file: invalid syntax (core.py, line 2882) Did you change the syntax from 2.x to 3.x? make[1]: *** [debian/rules:18: override_dh_auto_build] Error 2 If I try in the pbuilder chroot /build/uncertainties-3.0.2.github# python3 Python 3.6.7rc1 (default, Sep 27 2018, 09:51:25) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from uncertainties import core Traceback (most recent call last): File "", line 1, in File "/build/uncertainties-3.0.2.github/uncertainties/__init__.py", line 224, in from .core import * File "/build/uncertainties-3.0.2.github/uncertainties/core.py", line 2882 POSITIVE_DECIMAL_UNSIGNED_OR_NON_FINITE = ur'((\d*)(\.\d*)?|nan|NAN|inf|INF)' ^ SyntaxError: invalid syntax So this a different issue and I admit that the changes in core.py are different from the ones without python3-setuptools. Any hint how I could solve the latter issue since I'd prefer to ship the package without the ugly hack? Kind regards Andreas. -- http://fam-tille.de