Debian Bug report logs - #907370
TypeError: object of type 'int' has no len()

version graph

Package: python3-sh; Maintainer for python3-sh is Debian Python Team <team+python@tracker.debian.org>; Source for python3-sh is src:python-sh (PTS, buildd, popcon).

Reported by: Antoine Beaupre <anarcat@debian.org>

Date: Mon, 27 Aug 2018 03:54:01 UTC

Severity: grave

Tags: buster, patch, sid, upstream

Found in version python-sh/1.11-1

Fixed in version python-sh/1.12.14-1.1

Done: Antoine Beaupré <anarcat@debian.org>

Bug is archived. No further changes may be made.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#907370; Package python3-sh. (Mon, 27 Aug 2018 03:54:03 GMT) (full text, mbox, link).


Acknowledgement sent to Antoine Beaupre <anarcat@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Mon, 27 Aug 2018 03:54:03 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Antoine Beaupre <anarcat@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: TypeError: object of type 'int' has no len()
Date: Sun, 26 Aug 2018 23:51:32 -0400
Package: python3-sh
Version: 1.11-1
Severity: grave

I found a regression in the python3-sh package. I have yet to find
exactly what is going on, but it looks to me like something changed in
Python 3.6 that broke the sh module in some way:

$ lwn get -o blog/2017-12-13-kubecon-overview.mdwn https://lwn.net/Articles/741301/
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3/dist-packages/sh.py", line 1453, in input_thread
    done = stdin.write()
  File "/usr/lib/python3/dist-packages/sh.py", line 1799, in write
    self.log.debug("got chunk size %d: %r", len(proc_chunk),
TypeError: object of type 'int' has no len()

The source for the `lwn` command is here:

https://gitlab.com/anarcat/lwn/blob/master/lwn.py

It's totally unclear to me, from the backtrace, from *where* exactly
sh is being called, so I am having a hard time writing a
reproducer... But I am *guessing* it's this call:

    result = sh.pandoc(filter_args, _in=content)

But really, I have no frigging clue.

Any brilliant idea of what could possibly be going on here? This used
to work fine in Debian stretch (which has the same version of
python3-sh, so probably no change there).

My best guess so far is something changed in some standard library,
but I really have no idea...

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.17.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8), LANGUAGE=fr_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-sh depends on:
ii  python3  3.6.5-3

python3-sh recommends no packages.

python3-sh suggests no packages.

-- debconf-show failed



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#907370; Package python3-sh. (Tue, 04 Sep 2018 08:27:04 GMT) (full text, mbox, link).


Acknowledgement sent to Peter Pentchev <roam@ringlet.net>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Tue, 04 Sep 2018 08:27:04 GMT) (full text, mbox, link).


Message #10 received at 907370@bugs.debian.org (full text, mbox, reply):

From: Peter Pentchev <roam@ringlet.net>
To: Antoine Beaupre <anarcat@debian.org>
Cc: 907370@bugs.debian.org
Subject: Re: TypeError: object of type 'int' has no len()
Date: Tue, 4 Sep 2018 11:17:42 +0300
[Message part 1 (text/plain, inline)]
Control: tags -1 + upstream patch

On Sun, Aug 26, 2018 at 11:51:32PM -0400, Antoine Beaupre wrote:
> Package: python3-sh
> Version: 1.11-1
> Severity: grave
> 
> I found a regression in the python3-sh package. I have yet to find
> exactly what is going on, but it looks to me like something changed in
> Python 3.6 that broke the sh module in some way:
> 
> $ lwn get -o blog/2017-12-13-kubecon-overview.mdwn https://lwn.net/Articles/741301/
> Exception in thread Thread-1:
> Traceback (most recent call last):
>   File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
>     self.run()
>   File "/usr/lib/python3.6/threading.py", line 864, in run
>     self._target(*self._args, **self._kwargs)
>   File "/usr/lib/python3/dist-packages/sh.py", line 1453, in input_thread
>     done = stdin.write()
>   File "/usr/lib/python3/dist-packages/sh.py", line 1799, in write
>     self.log.debug("got chunk size %d: %r", len(proc_chunk),
> TypeError: object of type 'int' has no len()
> 
> The source for the `lwn` command is here:
> 
> https://gitlab.com/anarcat/lwn/blob/master/lwn.py
> 
> It's totally unclear to me, from the backtrace, from *where* exactly
> sh is being called, so I am having a hard time writing a
> reproducer... But I am *guessing* it's this call:
> 
>     result = sh.pandoc(filter_args, _in=content)
> 
> But really, I have no frigging clue.
> 
> Any brilliant idea of what could possibly be going on here? This used
> to work fine in Debian stretch (which has the same version of
> python3-sh, so probably no change there).
> 
> My best guess so far is something changed in some standard library,
> but I really have no idea...

I'm not really sure what changed to cause this bug, but I can certainly
reproduce it; moreover, it has been reported as a problem upstream[1]
and then fixed[2].  The attached patch (line numbers adapted for 1.11)
fixes it for me; an upgrade of python-sh to 1.12 or later would also fix
it.

Thanks for reporting this!

Best regards,
Peter

[1] https://github.com/amoffat/sh/issues/325
[2] https://github.com/amoffat/sh/commit/1460f6ee7ab521e1c443acdff8ec9f44069a196b

-- 
Peter Pentchev  roam@{ringlet.net,debian.org,FreeBSD.org} pp@storpool.com
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
[input-bytes.patch (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Added tag(s) upstream and patch. Request was from Peter Pentchev <roam@ringlet.net> to 907370-submit@bugs.debian.org. (Tue, 04 Sep 2018 08:27:04 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#907370; Package python3-sh. (Tue, 04 Sep 2018 12:45:09 GMT) (full text, mbox, link).


Acknowledgement sent to Antoine Beaupré <anarcat@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Tue, 04 Sep 2018 12:45:09 GMT) (full text, mbox, link).


Message #17 received at 907370@bugs.debian.org (full text, mbox, reply):

From: Antoine Beaupré <anarcat@debian.org>
To: Peter Pentchev <roam@ringlet.net>
Cc: 907370@bugs.debian.org
Subject: Re: TypeError: object of type 'int' has no len()
Date: Tue, 04 Sep 2018 08:41:09 -0400
On 2018-09-04 11:17:42, Peter Pentchev wrote:
> Control: tags -1 + upstream patch

[...]

> I'm not really sure what changed to cause this bug, but I can certainly
> reproduce it; moreover, it has been reported as a problem upstream[1]
> and then fixed[2].  The attached patch (line numbers adapted for 1.11)
> fixes it for me; an upgrade of python-sh to 1.12 or later would also fix
> it.

Awesome! That was quick! Anyone working on the upload? I'd be happy to
do a NMU... In fact, I'll work on a package here just to scratch that
itch...

A.



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#907370; Package python3-sh. (Tue, 04 Sep 2018 13:24:03 GMT) (full text, mbox, link).


Acknowledgement sent to Antoine Beaupre <anarcat@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Tue, 04 Sep 2018 13:24:03 GMT) (full text, mbox, link).


Message #22 received at 907370@bugs.debian.org (full text, mbox, reply):

From: Antoine Beaupre <anarcat@debian.org>
To: 907370@bugs.debian.org
Cc: Peter Pentchev <roam@ringlet.net>
Subject: python-sh: diff for NMU version 1.12.14-1.1
Date: Tue, 4 Sep 2018 09:21:09 -0400
[Message part 1 (text/plain, inline)]
Control: tags 907370 + pending

Dear maintainer,

I've prepared an NMU for python-sh (versioned as 1.12.14-1.1) and
uploaded it to DELAYED/10. Please feel free to tell me if I
should delay it longer.

A debdiff is attached and I pushed the resulting git repo here:

https://salsa.debian.org/anarcat/python-sh

Regards.
[python-sh-1.12.14-1.1-nmu.diff (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Added tag(s) pending. Request was from Antoine Beaupre <anarcat@debian.org> to 907370-submit@bugs.debian.org. (Tue, 04 Sep 2018 13:24:03 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#907370; Package python3-sh. (Tue, 04 Sep 2018 13:24:05 GMT) (full text, mbox, link).


Acknowledgement sent to Peter Pentchev <roam@ringlet.net>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Tue, 04 Sep 2018 13:24:05 GMT) (full text, mbox, link).


Message #29 received at 907370@bugs.debian.org (full text, mbox, reply):

From: Peter Pentchev <roam@ringlet.net>
To: Antoine Beaupré <anarcat@debian.org>
Cc: 907370@bugs.debian.org
Subject: Re: Bug#907370: TypeError: object of type 'int' has no len()
Date: Tue, 4 Sep 2018 16:21:31 +0300
[Message part 1 (text/plain, inline)]
On Tue, Sep 04, 2018 at 08:41:09AM -0400, Antoine Beaupré wrote:
> On 2018-09-04 11:17:42, Peter Pentchev wrote:
> > Control: tags -1 + upstream patch
> 
> [...]
> 
> > I'm not really sure what changed to cause this bug, but I can certainly
> > reproduce it; moreover, it has been reported as a problem upstream[1]
> > and then fixed[2].  The attached patch (line numbers adapted for 1.11)
> > fixes it for me; an upgrade of python-sh to 1.12 or later would also fix
> > it.
> 
> Awesome! That was quick! Anyone working on the upload? I'd be happy to
> do a NMU... In fact, I'll work on a package here just to scratch that
> itch...

I'm not part of the Debian Python Modules Team (yet, although I do
intend to join it soon; $RealWork has me doing enough Python development
lately), so I cannot really help with uploading it, except maybe for a
delayed NMU same as you, but I think it might be better to wait for
somebody from the team to answer :)

Best regards,
Peter

-- 
Peter Pentchev  roam@{ringlet.net,debian.org,FreeBSD.org} pp@storpool.com
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#907370; Package python3-sh. (Tue, 04 Sep 2018 13:30:03 GMT) (full text, mbox, link).


Acknowledgement sent to Antoine Beaupré <anarcat@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Tue, 04 Sep 2018 13:30:03 GMT) (full text, mbox, link).


Message #34 received at 907370@bugs.debian.org (full text, mbox, reply):

From: Antoine Beaupré <anarcat@debian.org>
To: Peter Pentchev <roam@ringlet.net>
Cc: 907370@bugs.debian.org
Subject: Re: Bug#907370: TypeError: object of type 'int' has no len()
Date: Tue, 04 Sep 2018 09:27:41 -0400
On 2018-09-04 16:21:31, Peter Pentchev wrote:
> On Tue, Sep 04, 2018 at 08:41:09AM -0400, Antoine Beaupré wrote:
>> On 2018-09-04 11:17:42, Peter Pentchev wrote:
>> > Control: tags -1 + upstream patch
>> 
>> [...]
>> 
>> > I'm not really sure what changed to cause this bug, but I can certainly
>> > reproduce it; moreover, it has been reported as a problem upstream[1]
>> > and then fixed[2].  The attached patch (line numbers adapted for 1.11)
>> > fixes it for me; an upgrade of python-sh to 1.12 or later would also fix
>> > it.
>> 
>> Awesome! That was quick! Anyone working on the upload? I'd be happy to
>> do a NMU... In fact, I'll work on a package here just to scratch that
>> itch...
>
> I'm not part of the Debian Python Modules Team (yet, although I do
> intend to join it soon; $RealWork has me doing enough Python development
> lately), so I cannot really help with uploading it, except maybe for a
> delayed NMU same as you, but I think it might be better to wait for
> somebody from the team to answer :)

Oh. Oops. Well, too late for that now. :) It's in DELAYED/10 so no harm
done, I guess.

I guess I should also join the thing as well...

A.

-- 
Non qui parum habet, sed qui plus cupit, pauper est.
It is not the man who has too little, but the man who craves more,
that is poor.            - Lucius Annaeus Seneca (65 AD)



Added tag(s) sid and buster. Request was from Andreas Beckmann <anbe@debian.org> to control@bugs.debian.org. (Tue, 04 Sep 2018 22:45:07 GMT) (full text, mbox, link).


Reply sent to Antoine Beaupré <anarcat@debian.org>:
You have taken responsibility. (Fri, 14 Sep 2018 14:45:06 GMT) (full text, mbox, link).


Notification sent to Antoine Beaupre <anarcat@debian.org>:
Bug acknowledged by developer. (Fri, 14 Sep 2018 14:45:06 GMT) (full text, mbox, link).


Message #41 received at 907370-close@bugs.debian.org (full text, mbox, reply):

From: Antoine Beaupré <anarcat@debian.org>
To: 907370-close@bugs.debian.org
Subject: Bug#907370: fixed in python-sh 1.12.14-1.1
Date: Fri, 14 Sep 2018 14:40:57 +0000
Source: python-sh
Source-Version: 1.12.14-1.1

We believe that the bug you reported is fixed in the latest version of
python-sh, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 907370@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Antoine Beaupré <anarcat@debian.org> (supplier of updated python-sh package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 04 Sep 2018 09:04:49 -0400
Source: python-sh
Binary: python-sh python3-sh
Architecture: source
Version: 1.12.14-1.1
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Changed-By: Antoine Beaupré <anarcat@debian.org>
Description:
 python-sh  - Python subprocess interface
 python3-sh - Python 3 subprocess interface
Closes: 907370
Changes:
 python-sh (1.12.14-1.1) unstable; urgency=medium
 .
   [ Antoine Beaupré ]
   * Non-maintainer upload
   * New upstream version 1.12.14 (Closes: #907370)
 .
   [ Ondřej Nový ]
   * Fixed VCS URL (https)
   * d/control: Set Vcs-* to salsa.debian.org
   * d/copyright: Fix Format URL to correct one
   * d/watch: Use https protocol
   * d/control: Remove ancient X-Python-Version field
   * d/control: Remove ancient X-Python3-Version field
   * Convert git repository from git-dpm to gbp layout
Checksums-Sha1:
 0a945aec99d8f3d11853cacc3ce70cae0dc4e7e8 1799 python-sh_1.12.14-1.1.dsc
 4ba53052560bedc70f8f1cd305c593f8c75f9d10 57288 python-sh_1.12.14.orig.tar.gz
 74eade71871761ec162b906ccb7f88727e5043d3 2596 python-sh_1.12.14-1.1.debian.tar.xz
 1e73caeed19ef00eb1c84e45815ec30161df835b 6632 python-sh_1.12.14-1.1_amd64.buildinfo
Checksums-Sha256:
 e3530a4117b85e6473c2d2c29a547832c9cd0f06e6064611b0c82f887c1ccdfe 1799 python-sh_1.12.14-1.1.dsc
 2347dc0ebcb47370308ebd2499456c6d7ce50d4b693230c91377038f45d88d8d 57288 python-sh_1.12.14.orig.tar.gz
 637dd735927d4f6d6bca5ee53088ffd1221878f7692473825670ade573e76de8 2596 python-sh_1.12.14-1.1.debian.tar.xz
 7c385010c3213beb7d8034a3758304233ec45ff1e884683215931cd8fba60e93 6632 python-sh_1.12.14-1.1_amd64.buildinfo
Files:
 09725e03e258a49587b1c1d96227ad79 1799 python optional python-sh_1.12.14-1.1.dsc
 e5dc0daf4ff5f80c08075c6c38ff1322 57288 python optional python-sh_1.12.14.orig.tar.gz
 e4a88fc6c2d2ead622055a9d6202263b 2596 python optional python-sh_1.12.14-1.1.debian.tar.xz
 c3cc9b0148b15cf74d0d00e0555c0712 6632 python optional python-sh_1.12.14-1.1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEexZCBNCWcjsBljWrPqHd3bJh2XsFAluOhbsACgkQPqHd3bJh
2Xs0Ugf9FaDotQR5EhDtoX6MmHKv0K6aJOZ08AaUHSfJM5d4ZQrfyAB4iLxEK6WR
Y8jv58O1CusACRG6Z6oaycSCmAR8gf1q5Rn9qG+He/HiFvhDdnND07zL4Wi+z1Ea
hOzPKhpvn0Ytdq2XEI2+mKnJiYZDdHHNmMygWZNJJhhzZKBVDfrXciJwBM+LWmJq
g82SEDTkAO60m/KTJaOrNKBSS5t2AJijVfCePwGhbqnJGV4S1s5M1hRFIozDgyJi
e4WZoQPqaDB4UCglIRXogAu9wbvmfZi6Sdqj6ifd9Pfrbv8P9pte9E+di5kJzt8y
TL/uqlaGbyfyfI/somvDXc0kLLf03g==
=mQHQ
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 18 Oct 2018 07:29:19 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Nov 21 22:50:47 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.