Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #10975 > unrolled thread

Re: Updated python-uncertainties

Started byAndreas Tille <andreas@an3as.eu>
First post2018-10-12 08:20 +0200
Last post2018-10-17 19:50 +0200
Articles 20 on this page of 24 — 7 participants

Back to article view | Back to linux.debian.maint.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Updated python-uncertainties Andreas Tille <andreas@an3as.eu> - 2018-10-12 08:20 +0200
    TypeError: ord() expected a character, but string of length 3 found  (Was: Updated python-uncertainties) Andreas Tille <andreas@an3as.eu> - 2018-10-12 13:20 +0200
      Re: TypeError: ord() expected a character,  but string of length 3 found (Was: Updated python-uncertainties) Chris Lamb <lamby@debian.org> - 2018-10-12 13:50 +0200
        Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Andreas Tille <tille@debian.org> - 2018-10-12 14:50 +0200
          Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Andreas Tille <tille@debian.org> - 2018-10-12 16:20 +0200
            Re: TypeError: ord() expected a character,  but string of length 3 found (Was: Updated python-uncertainties) Chris Lamb <lamby@debian.org> - 2018-10-12 16:40 +0200
            RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-12 17:10 +0200
              RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-12 17:40 +0200
                Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Piotr Ożarowski <piotr@debian.org> - 2018-10-12 18:20 +0200
                  RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-12 18:40 +0200
                  RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-13 11:10 +0200
                    RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-13 11:50 +0200
                    RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-13 14:00 +0200
                  Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Andreas Tille <andreas@an3as.eu> - 2018-10-15 11:40 +0200
                    RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-15 12:00 +0200
                      Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Karsten Hilbert <Karsten.Hilbert@gmx.net> - 2018-10-15 12:10 +0200
                      Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Andreas Tille <andreas@an3as.eu> - 2018-10-15 13:20 +0200
                        RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-15 14:10 +0200
                          RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-15 21:20 +0200
                            Re: TypeError: ord() expected a character,  but string of length 3 found (Was: Updated python-uncertainties) Chris Lamb <lamby@debian.org> - 2018-10-15 22:10 +0200
                        RE:TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2018-10-15 21:10 +0200
                          Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Andreas Tille <andreas@an3as.eu> - 2018-10-16 09:10 +0200
                            Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Dmitry Shachnev <mitya57@debian.org> - 2018-10-17 16:40 +0200
                              Re: TypeError: ord() expected a character, but string of length 3  found (Was: Updated python-uncertainties) Andreas Tille <tille@debian.org> - 2018-10-17 19:50 +0200

Page 1 of 2  [1] 2  Next page →


#10975 — Re: Updated python-uncertainties

FromAndreas Tille <andreas@an3as.eu>
Date2018-10-12 08:20 +0200
SubjectRe: Updated python-uncertainties
Message-ID<wHYXL-6cv-1@gated-at.bofh.it>
Hi,

I need help with an issue in python-uncertainties[2].  It only occures
with Python 2:

$ python
Python 2.7.15+ (default, Aug 31 2018, 11:56:52) 
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from uncertainties import core
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/uncertainties/__init__.py", line 224, in <module>
    from .core import *
  File "/usr/lib/python2.7/dist-packages/uncertainties/core.py", line 946, in <module>
    ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}
  File "/usr/lib/python2.7/dist-packages/uncertainties/core.py", line 946, in <dictcomp>
    ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}
TypeError: ord() expected a character, but string of length 3 found
>>> 

With Python 3 everything is fine.

Any idea what might be wrong?

Please note that I commited a new upstream tarball to Git.  It has the
same release version but pypi contains a totally different release
tarball than Github (different file site and different dirs).  I was
told that the Github version works "better" but this specific error
occures for both.  I'd recommend to use the current HEAD in Git anyway
since that version looks more "sensible" in some way.

I would also love if someone would check whether dh_auto_test is working
correctly.  I somehow see no sign that the test suite is executed - thus
the problem above seems to remain hidden.

Kind regards and thanks for any help

      Andreas.

On Thu, Oct 11, 2018 at 01:06:43PM +0200, Andreas Tille wrote:
> Hi,
> 
> I'm working on bugs #906381 and #906419 of package lmfit-py which should
> be solved in the latest upstream version.  As it is documented in the
> lmfit-py issue tracker[1] this latest version needs python-uncertainties
> >= 3.0 which was prepared by Federico in Git[2].  Since it did not build
> I fixed the build issues and did a team upload (if I understood David
> Paleino correctly team maintenance in DPMT is fine and thus I have set
> the team as maintainer - I hope this is fine with you.  Since another
> upload will be needed (see below) I'm fine with reverting this) of the
> upstream source that was injected.
> 
> According to lmfit-py upstream[3] there is some issue with the
> uncertainties release and it seems we are now dealing with the wrong
> code.  I just want to let you know you about my past upload and that
> I intend to do another upload until that issue[3] is fixed.
> 
> Kind regards
> 
>         Andreas.
> 
> PS: I'd consider it sensible to move the Git repository of
>     python-uncertainties from debian/ group on Salsa to
>     python-team/modules if you agree but before doing so I'd love
>     to hear some confirmation that this is OK and that all Uploaders
>     are member of DPMT and are able to keep on commiting.
> 
> 
> [1] https://github.com/lmfit/lmfit-py/issues/502
> [2] https://salsa.debian.org/debian/python-uncertainties
> [3] https://github.com/lmfit/lmfit-py/issues/502#issuecomment-428638278
> 
> -- 
> http://fam-tille.de

-- 
http://fam-tille.de

[toc] | [next] | [standalone]


#10980 — TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromAndreas Tille <andreas@an3as.eu>
Date2018-10-12 13:20 +0200
SubjectTypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI3E5-vZ-11@gated-at.bofh.it>
In reply to#10975
Hi again,

I've now stumbled upon the `export PYBUILD_DISABLE=test` some Uploader
had commited.  This is now deactivated in Git[2].  Any idea how to get
this working?

Kind regards

        Andreas.

[2] https://salsa.debian.org/debian/python-uncertainties

On Fri, Oct 12, 2018 at 08:19:02AM +0200, Andreas Tille wrote:
> Hi,
> 
> I need help with an issue in python-uncertainties[2].  It only occures
> with Python 2:
> 
> $ python
> Python 2.7.15+ (default, Aug 31 2018, 11:56:52) 
> [GCC 8.2.0] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from uncertainties import core
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.7/dist-packages/uncertainties/__init__.py", line 224, in <module>
>     from .core import *
>   File "/usr/lib/python2.7/dist-packages/uncertainties/core.py", line 946, in <module>
>     ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}
>   File "/usr/lib/python2.7/dist-packages/uncertainties/core.py", line 946, in <dictcomp>
>     ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}
> TypeError: ord() expected a character, but string of length 3 found
> >>> 
> 
> With Python 3 everything is fine.
> 
> Any idea what might be wrong?
> 
> Please note that I commited a new upstream tarball to Git.  It has the
> same release version but pypi contains a totally different release
> tarball than Github (different file site and different dirs).  I was
> told that the Github version works "better" but this specific error
> occures for both.  I'd recommend to use the current HEAD in Git anyway
> since that version looks more "sensible" in some way.
> 
> I would also love if someone would check whether dh_auto_test is working
> correctly.  I somehow see no sign that the test suite is executed - thus
> the problem above seems to remain hidden.
> 
> Kind regards and thanks for any help
> 
>       Andreas.
> 
> On Thu, Oct 11, 2018 at 01:06:43PM +0200, Andreas Tille wrote:
> > Hi,
> > 
> > I'm working on bugs #906381 and #906419 of package lmfit-py which should
> > be solved in the latest upstream version.  As it is documented in the
> > lmfit-py issue tracker[1] this latest version needs python-uncertainties
> > >= 3.0 which was prepared by Federico in Git[2].  Since it did not build
> > I fixed the build issues and did a team upload (if I understood David
> > Paleino correctly team maintenance in DPMT is fine and thus I have set
> > the team as maintainer - I hope this is fine with you.  Since another
> > upload will be needed (see below) I'm fine with reverting this) of the
> > upstream source that was injected.
> > 
> > According to lmfit-py upstream[3] there is some issue with the
> > uncertainties release and it seems we are now dealing with the wrong
> > code.  I just want to let you know you about my past upload and that
> > I intend to do another upload until that issue[3] is fixed.
> > 
> > Kind regards
> > 
> >         Andreas.
> > 
> > PS: I'd consider it sensible to move the Git repository of
> >     python-uncertainties from debian/ group on Salsa to
> >     python-team/modules if you agree but before doing so I'd love
> >     to hear some confirmation that this is OK and that all Uploaders
> >     are member of DPMT and are able to keep on commiting.
> > 
> > 
> > [1] https://github.com/lmfit/lmfit-py/issues/502
> > [2] https://salsa.debian.org/debian/python-uncertainties
> > [3] https://github.com/lmfit/lmfit-py/issues/502#issuecomment-428638278
> > 
> > -- 
> > http://fam-tille.de
> 
> -- 
> http://fam-tille.de
> 
> 

-- 
http://fam-tille.de

[toc] | [prev] | [next] | [standalone]


#10981 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromChris Lamb <lamby@debian.org>
Date2018-10-12 13:50 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI477-F5-3@gated-at.bofh.it>
In reply to#10980
Andreas,


> >   File "/usr/lib/python2.7/dist-packages/uncertainties/core.py", line 946, in <dictcomp>
> >     ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}

Please always provide a minimal testcase, otherwise people have to do a
lot of work simply to get where you are..

  $ cat testcase.py
  # coding=utf-8
  TO_SUPERSCRIPT = {
      0x2b: '⁺',
      0x2d: '⁻',
      0x30: '⁰',
      0x31: '¹',
      0x32: '²',
      0x33: '³',
      0x34: '⁴',
      0x35: '⁵',
      0x36: '⁶',
      0x37: '⁷',
      0x38: '⁸',
      0x39: '⁹'
      }
  #! Python 2.7+ can use a dictionary comprehension instead:
  FROM_SUPERSCRIPT = {
      ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}

  $ python2 testcase.py  
  Traceback (most recent call last):
    File "testcase.py", line 18, in <module>
      ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}
    File "testcase.py", line 18, in <dictcomp>
      ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}
  TypeError: ord() expected a character, but string of length 3 found


Under Python 2.x, list(TO_SUPERSCRIPT.items()) is:

  [(43, '\xe2\x81\xba'),
   (45, '\xe2\x81\xbb'),
   (48, '\xe2\x81\xb0'),
   […]
  ]

ie. strings with a length of 3 whilst ord() takes a single char. These
should therefore be probably defined as:

  TO_SUPERSCRIPT = {
      0x2b: u'⁺',
      0x2d: u'⁻',
  […]

.. instead, but I haven't tested or confirmed or anythinged that; I'll
leave it with you and upstream.

I also couldn't help notice:

  Vcs-Browser: https://salsa.debian.org/debian/python-uncertainties
  Vcs-Git: https://salsa.debian.org/debian/python-uncertainties.git

.. yet:

  Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-

[toc] | [prev] | [next] | [standalone]


#10984 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromAndreas Tille <tille@debian.org>
Date2018-10-12 14:50 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI53b-1cW-1@gated-at.bofh.it>
In reply to#10981
Hi Chris,

On Fri, Oct 12, 2018 at 12:32:18PM +0100, Chris Lamb wrote:
> 
> > >   File "/usr/lib/python2.7/dist-packages/uncertainties/core.py", line 946, in <dictcomp>
> > >     ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}
> 
> Please always provide a minimal testcase, otherwise people have to do a
> lot of work simply to get where you are..

Hmmm, I've thought the "test case" I've given in my first mail, just
doing

   from uncertainties import core

would be sufficient.
 
> Under Python 2.x, list(TO_SUPERSCRIPT.items()) is:
> 
>   [(43, '\xe2\x81\xba'),
>    (45, '\xe2\x81\xbb'),
>    (48, '\xe2\x81\xb0'),
>    […]
>   ]
> 
> ie. strings with a length of 3 whilst ord() takes a single char. These
> should therefore be probably defined as:
> 
>   TO_SUPERSCRIPT = {
>       0x2b: u'⁺',
>       0x2d: u'⁻',
>   […]
> 
> .. instead, but I haven't tested or confirmed or anythinged that; I'll
> leave it with you and upstream.

I will contact upstream but I wanted to hear the opinion of the
Uploaders of this package.
 
> I also couldn't help notice:
> 
>   Vcs-Browser: https://salsa.debian.org/debian/python-uncertainties
>   Vcs-Git: https://salsa.debian.org/debian/python-uncertainties.git
> 
> .. yet:
> 
>   Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>

That's probably explained in my other mail I've wrongly sent to
python-modules-team list where it might have not been noticed by you.  I
wanted the Uploaders confirm the move to DPMT and make sure they have
commit permissions before the repository is moved.

Kind regards

      Andreas.

[1] https://lists.debian.org/debian-python/2018/10/msg00020.html
[2] https://alioth-lists.debian.net/pipermail/python-modules-team/2018-October/050019.html

-- 
http://fam-tille.de

[toc] | [prev] | [next] | [standalone]


#10985 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromAndreas Tille <tille@debian.org>
Date2018-10-12 16:20 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI6si-28W-9@gated-at.bofh.it>
In reply to#10984
Hi again,

On Fri, Oct 12, 2018 at 02:44:26PM +0200, Andreas Tille wrote:
> > 
> > > >   File "/usr/lib/python2.7/dist-packages/uncertainties/core.py", line 946, in <dictcomp>
> > > >     ord(sup): normal for (normal, sup) in list(TO_SUPERSCRIPT.items())}
> > 
> > Please always provide a minimal testcase, otherwise people have to do a
> > lot of work simply to get where you are..
> 
> Hmmm, I've thought the "test case" I've given in my first mail, just
> doing
> 
>    from uncertainties import core
> 
> would be sufficient.
>  
> > Under Python 2.x, list(TO_SUPERSCRIPT.items()) is:
> > 
> >   [(43, '\xe2\x81\xba'),
> >    (45, '\xe2\x81\xbb'),
> >    (48, '\xe2\x81\xb0'),
> >    […]
> >   ]
> > 
> > ie. strings with a length of 3 whilst ord() takes a single char. These
> > should therefore be probably defined as:
> > 
> >   TO_SUPERSCRIPT = {
> >       0x2b: u'⁺',
> >       0x2d: u'⁻',
> >   […]
> > 
> > .. instead, but I haven't tested or confirmed or anythinged that; I'll
> > leave it with you and upstream.
> 
> I will contact upstream but I wanted to hear the opinion of the
> Uploaders of this package.

Before I discuss this with upstream I'd like to share another observation:
There is some 2to3 magic applied to the source code which has the effect
that the original source code file which has

$ grep -A4 "^TO_SUPERSCRIPT = {" uncertainties/core.py
TO_SUPERSCRIPT = {
    0x2b: u'⁺',
    0x2d: u'⁻',
    0x30: u'⁰',
    0x31: u'¹',

is turned into

grep -A4 "^TO_SUPERSCRIPT = {" uncertainties/core.py
TO_SUPERSCRIPT = {
    0x2b: '⁺',
    0x2d: '⁻',
    0x30: '⁰',
    0x31: '¹',

inside the pbuilder environment.  I hacked around with the following code:

+
+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
+endif
 

which left me with other test suite failures.  Since I'm totally new to
this package and I have no idea whether this is some Debian specific
build (I had some quite unfriendly conversation with lmfit-py
upstream[1]) so would like to make sure there is no Debian specific
issue first.  (Disclaimer:  I'm totally new to this package as well as
lmfit-py - a Debian Med package just depends from the latter and nobody
else seem to have free time cycles to care.  So please excuse my
naivity.)

Kind regards

       Andreas.

[1] https://github.com/lmfit/lmfit-py/issues/502

-- 
http://fam-tille.de

[toc] | [prev] | [next] | [standalone]


#10986 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromChris Lamb <lamby@debian.org>
Date2018-10-12 16:40 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI6LE-2fF-5@gated-at.bofh.it>
In reply to#10985
Andreas,

> Before I discuss this with upstream I'd like to share another observation:
> There is some 2to3 magic applied to the source code which has the effect
> that

Assuming it's upstream's 2to3 magic, then I would speak to them. Alas,
I am new to this package too — good luck and I hope I was of some
initial help.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-

[toc] | [prev] | [next] | [standalone]


#10987 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-12 17:10 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI7eF-2Ex-1@gated-at.bofh.it>
In reply to#10985
Hello Andreas,

during the test does it load the moduels from the source files or does it use the one under the build directory.
Maybe there is a missmatch between python2 code and 2to3 python code targeting python3.

did it helped ?

Fred

[toc] | [prev] | [next] | [standalone]


#10989 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-12 17:40 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI7HH-2NC-7@gated-at.bofh.it>
In reply to#10987
Hello Andreas, it seems to me that the problem is due to the 2to3 conversion.

I looked at the first failure when you re-activate the unit test[1]

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.

So I guess that the pythoncode used for python2 is already the code modified  for python3...

this is why the code failed for the unit test.

[1] https://salsa.debian.org/debian/python-uncertainties/-/jobs/53314

[toc] | [prev] | [next] | [standalone]


#10991 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPiotr Ożarowski <piotr@debian.org>
Date2018-10-12 18:20 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI8kp-3eW-1@gated-at.bofh.it>
In reply to#10989
[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
-- 
GPG: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

[toc] | [prev] | [next] | [standalone]


#10992 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-12 18:40 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wI8DL-3kX-7@gated-at.bofh.it>
In reply to#10991
You are right , I did not noticed, that setuptools was not part of the build dependencies...

[toc] | [prev] | [next] | [standalone]


#10999 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-13 11:10 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wIo5Q-48l-3@gated-at.bofh.it>
In reply to#10991
> try adding python3-setuptools to Build-Depends

ok I removed all the black magic from the debian/rules and added setuptools :)

so now, I have this error when building the documentation

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 programable error in your configuration file:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/config.py", line 161, in __init__
    execfile_(filename, config)
  File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line 150, in execfile_
    exec_(code, _globals)
  File "conf.py", line 19, in <module>
    import uncertainties
  File "/<<PKGBUILDDIR>>/uncertainties/__init__.py", line 224, in <module>
    from .core import *
  File "/<<PKGBUILDDIR>>/uncertainties/core.py", line 946, in <module>
    ord(sup): normal for (normal, sup) in TO_SUPERSCRIPT.iteritems()}
AttributeError: 'dict' object has no attribute 'iteritems'


As we can see sphinx-build even if we gives the PYTHONPATH, load the modules from the source directory

  File "/<<PKGBUILDDIR>>/uncertainties/core.py", line 946, in <module>

and not from

/<<PKGBUILDDIR>>/.pybuild/cpython3_3.6_uncertainties/build/

which should contain the module updated with 2to3.

what is the proper way to build sphinx doc during a build process ?

Cheers

Frederic

[toc] | [prev] | [next] | [standalone]


#11000 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-13 11:50 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wIoIy-4kB-15@gated-at.bofh.it>
In reply to#10999
Now the test part :))


Correlated variables. ... ok
Tests the input of correlated value. ... ok

======================================================================
ERROR: Failure: ImportError (No module named tests.support)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/<<PKGBUILDDIR>>/.pybuild/cpython2_2.7_uncertainties/build/uncertainties/lib1to2/test_1to2.py", line 42, in <module>
    import lib2to3.tests.support as support
ImportError: No module named tests.support


do you know which package provide this test.suport module in lib2to3 ?

thanks

Frederic

[toc] | [prev] | [next] | [standalone]


#11001 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-13 14:00 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wIqKl-5uw-5@gated-at.bofh.it>
In reply to#10999
I found the culprite, the conf.py file of the documentations prepend ".." to sys.path befor importing the module.
This is why it use the wrong version of the built module.


Now during the build I have this

D: dh_python3 dh_python3:164: args: []
D: dh_python3 dh_python3:166: supported Python versions: 3.6,3.7 (default=3.6)
D: dh_python3 debhelper:107: skipping package: python-uncertainties
D: dh_python3 debhelper:153: source=uncertainties, binary packages=['python3-uncertainties']
D: dh_python3 dh_python3:183: processing package python3-uncertainties...
D: dh_python3 fs:49: moving files from debian/python3-uncertainties/usr/lib/python3.6/dist-packages to debian/python3-uncertainties/usr/lib/python3/dist-packages/
D: dh_python3 fs:49: moving files from debian/python3-uncertainties/usr/lib/python3.7/dist-packages to debian/python3-uncertainties/usr/lib/python3/dist-packages/
W: dh_python3 fs:98: Paths differ: debian/python3-uncertainties/usr/lib/python3.7/dist-packages/uncertainties/core.py and debian/python3-uncertainties/usr/lib/python3/dist-packages/uncertainties/core.py
W: dh_python3 fs:98: Paths differ: debian/python3-uncertainties/usr/lib/python3.7/dist-packages/uncertainties/lib1to2/test_1to2.py and debian/python3-uncertainties/usr/lib/python3/dist-packages/uncertainties/lib1to2/test_1to2.py
W: dh_python3 fs:98: Paths differ: debian/python3-uncertainties/usr/lib/python3.7/dist-packages/uncertainties/umath_core.py and debian/python3-uncertainties/usr/lib/python3/dist-packages/uncertainties/umath_core.py
D: dh_python3 fs:246: package python3-uncertainties details = {'requires.txt': {'debian/python3-uncertainties/usr/lib/python3/dist-packages/uncertainties-3.0.2.egg-info/requires.txt'}, 'egg-info': set(), 'nsp.txt': set(), 'shebangs': set(), 'public_vers': {Version('3'), Version('3.7')}, 'private_dirs': {}, 'compile': True, 'ext_vers': set(), 'ext_no_version': set()}



I am worried by the dh_python3 warnings.
It seems that the 2to3 files generated  by python3.6 and python3.7 differ.

I am right ?, and then what is the right way to solve this issue ?


thanks


Frederic

[toc] | [prev] | [next] | [standalone]


#11002 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromAndreas Tille <andreas@an3as.eu>
Date2018-10-15 11:40 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wJ7vX-5Ep-5@gated-at.bofh.it>
In reply to#10991
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 "<stdin>", line 1, in <module>
  File "/build/uncertainties-3.0.2.github/uncertainties/__init__.py", line 224, in <module>
    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

[toc] | [prev] | [next] | [standalone]


#11003 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-15 12:00 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wJ7Pk-5L3-3@gated-at.bofh.it>
In reply to#11002
I found in the code a string with a ur''

This is the problematic line.

I do not know if this is a valid string construction.

I also dound that you need to remove the sys.path modifications from the conf.py.

this can cause some troubles during the build.

Cheers.

Fred

[toc] | [prev] | [next] | [standalone]


#11004 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromKarsten Hilbert <Karsten.Hilbert@gmx.net>
Date2018-10-15 12:10 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wJ7YZ-64k-7@gated-at.bofh.it>
In reply to#11003
On Mon, Oct 15, 2018 at 09:40:27AM +0000, PICCA Frederic-Emmanuel wrote:

> I found in the code a string with a ur''
> 
> This is the problematic line.
> 
> I do not know if this is a valid string construction.

Under Python 2 it is.

Under Python 3 it is not.

	u'test' is valid but extraneous
	r'test' is valid but extraneous

Since this is about reguular expressions I would suggest just
using 'the regex' under Python 3.

Karsten
-- 
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B

[toc] | [prev] | [next] | [standalone]


#11005 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromAndreas Tille <andreas@an3as.eu>
Date2018-10-15 13:20 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wJ94K-6Gy-9@gated-at.bofh.it>
In reply to#11003
Hi,

On Mon, Oct 15, 2018 at 09:40:27AM +0000, PICCA Frederic-Emmanuel wrote:
> I found in the code a string with a ur''
> 
> This is the problematic line.
> 
> I do not know if this is a valid string construction.

Patches are welcome (I have no idea what the construct is doing neither
how to replace it with something valid).
 
> I also dound that you need to remove the sys.path modifications from the conf.py.
> 
> this can cause some troubles during the build.

Patch welcome as well - preferably as commit to Git.

Kind regards

       Andreas.

-- 
http://fam-tille.de

[toc] | [prev] | [next] | [standalone]


#11006 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-15 14:10 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wJ9R7-7bp-3@gated-at.bofh.it>
In reply to#11005
I think that the real problem with the current build is that the conf.py file  change the sys.path.

this is why we see this syntax eror.
sphinx pick the wrong path.

I can not  work on this now..., I am not in fron of a Debian box nor have access to one  todays...


Cheers

Fred

[toc] | [prev] | [next] | [standalone]


#11008 — RE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromPICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
Date2018-10-15 21:20 +0200
SubjectRE:TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wJgzf-2QG-3@gated-at.bofh.it>
In reply to#11006
Hello, here a diff between the python3.6 and python3.7 modules once  updated via 2to3.


r:/tmp$ diff core*
174c174
<             for (variance, tag) in zip(variances, tags))
---
>             for (variance, tag) in list(zip(variances, tags)))
181c181
<             for (coords, value) in zip(transform, nom_values))
---
>             for (coords, value) in list(zip(transform, nom_values)))
946c946
<     ord(sup): normal for (normal, sup) in TO_SUPERSCRIPT.items()}
---
>     ord(sup): normal for (normal, sup) in iter(TO_SUPERSCRIPT.items())}
1776c1776
<             delta**2 for delta in self.error_components().values())))
---
>             delta**2 for delta in iter(self.error_components().values()))))


can python expert explain if this seems correct or not ?

thanks for your help.

Frederic

[toc] | [prev] | [next] | [standalone]


#11009 — Re: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)

FromChris Lamb <lamby@debian.org>
Date2018-10-15 22:10 +0200
SubjectRe: TypeError: ord() expected a character, but string of length 3 found (Was: Updated python-uncertainties)
Message-ID<wJhlD-3n4-9@gated-at.bofh.it>
In reply to#11008
Picca,

Hi PICCA Frederic-Emmanuel,

> Hello, here a diff between the python3.6 and python3.7 modules

Please use "unified" (ie. diff -u, possibly diff -urNad) over old-style
diffs in future

> <     ord(sup): normal for (normal, sup) in TO_SUPERSCRIPT.items()}
> >     ord(sup): normal for (normal, sup) in iter(TO_SUPERSCRIPT.items())}
                                              ^^^^

No expert and I assume it works, but this doesn't "smell" right to me. 


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.debian.maint.python


csiph-web