Subject: bug#528: python3-reportbug: fails to install due to syntax error

From: "Gerard H. Pille" <[email-masked]>
Date: Sat, 5 Dec 2020 00:03:34 +0100

Package: python3-reportbug Version: 7.8.0+devuan1 Severity: grave
Justification: renders package unusable

Dear Maintainer,

*** Reporter, please consider answering these questions, where
appropriate ***

    * What led up to the situation?
upgrade from ascii to chimaera (not dist-upgrade)
    * What exactly did you do (or not do) that was effective (or
      ineffective)?
    * What was the outcome of this action?
this package failed to upgrade
# dpkg -i python3-reportbug_7.8.0+devuan1_all.deb
(Reading database ... 119108 files and directories currently installed.)
Preparing to unpack python3-reportbug_7.8.0+devuan1_all.deb ...
Unpacking python3-reportbug (7.8.0+devuan1) over (7.8.0+devuan1) ...
Setting up python3-reportbug (7.8.0+devuan1) ...
   File "/usr/lib/python3/dist-packages/reportbug/utils.py", line 1214
     init += f', PID 1: {pf.read().strip()}'
                                           ^
SyntaxError: invalid syntax

dpkg: error processing package python3-reportbug (--install):
  subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
  python3-reportbug

    * What outcome did you expect instead?

-- System Information: Distributor ID:  Devuan Description:     Devuan
GNU/Linux 4.0.0 (n/a) Release:  4.0.0 Codename: n/a Architecture: x86_64

Kernel: Linux 4.9.0-11-amd64 (SMP w/4 CPU threads) Kernel taint flags:
TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE Locale: LANG=C, LC_CTYPE=C
(charmap=ANSI_X3.4-1968), LANGUAGE=nl_BE:nl Shell: /bin/sh linked to
/bin/dash Init: sysvinit (via /sbin/init)

Versions of packages python3-reportbug depends on: ii apt 2.1.11+devuan1
ii file 1:5.38-5 ii python3 3.5.3-1 ii python3-apt 1.4.1 ii
python3-debian 0.1.38 ii python3-debianbts 3.0.2 ii python3-requests
2.12.4-1 ii sensible-utils 0.0.12+nmu1

python3-reportbug recommends no packages.

Versions of packages python3-reportbug suggests: ii reportbug
7.8.0+devuan1

-- no debconf information

---

From: Mark Hindley <[email-masked]>
Date: Sat, 5 Dec 2020 10:28:08 +0000

Control: tags -1 moreinfo

Gerard,

Thanks for this. However, can't yet reproduce it.

> SyntaxError: invalid syntax

Strange. This seems to imply that the python interpreter doesn understand the
f-string.  Presumably it is running under python2? What python2 pacakges do you
have installed?

 dpkg -l | grep python2 should producs a list.

Thanks

Mark

---

From: Mark Hindley <[email-masked]>
Date: Sat, 5 Dec 2020 13:31:15 +0000

On Sat, Dec 05, 2020 at 11:48:42AM +0100, Gerard H. Pille wrote:
> ghp-amdphIIx4a:/root
> # dpkg -l | grep python2
> ii  libpython2.7-minimal:amd64             2.7.18-1      amd64
> Minimal subset of the Python language (version 2.7)
> ii  libpython2.7-stdlib:amd64              2.7.18-1      amd64
> Interactive high-level object-oriented language (standard library, version
> 2.7)
> ii  python2.7                              2.7.18-1      amd64
> Interactive high-level object-oriented language (version 2.7)
> ii  python2.7-minimal                      2.7.18-1      amd64
> Minimal subset of the Python language (version 2.7)
> 
> 
> But I have python3 installed too.  This is a backup system I rarely use, try
> to keep it as standard Devuan as possible.  On the systems I work on
> regularly, I make sure python3 is the default.

Does /usr/bin/python exist? Which package does it belong to? Is it a symlink,
and if so, what to?

> I didn't know about the "f-string".

No, neither did I until I looked at this!

Thanks

Mark

---

From: Mark Hindley <[email-masked]>
Date: Sat, 5 Dec 2020 16:41:53 +0000

Gerard,

On Sat, Dec 05, 2020 at 02:34:21PM +0100, Gerard H. Pille wrote:
> Mark Hindley wrote:
> # ls -al /usr/bin/python
> lrwxrwxrwx 1 root root 9 24 jan  2017 /usr/bin/python -> python2.7
> 
> According to the date, this is not my doing.  System was installed a year
> ago on a disk that hadn't seen Linux before.

Does it belong to any installed package? 'dpkg -S /usr/bin/python' should tell
you.

Even with a /usr/bin/python -> python2 symlink I am unable to get the postinst
to fail as it does in your case. Somehow you appear to have a python2 interpreter
which is trying to compile python3 code. I can't see how that could happen.

Can you check your python3 versions? I get:

 $ python3 -V
 Python 3.9.1rc1

Any extraneous symlinks in /usr/local/bin or elsewhere in the $PATH?

Thanks.

Mark

---

From: Mark Hindley <[email-masked]>
Date: Sat, 5 Dec 2020 20:26:16 +0000

Control: tags -1 invalid
Control: close -1

On Sat, Dec 05, 2020 at 08:05:34PM +0100, Gerard H. Pille wrote:
> # dpkg -S $(which python)
> python-minimal: /usr/bin/python
> 
> # python3 -V
> Python 3.8.6
> 
> # python2 -V
> Python 2.7.18
> 
> # python -V
> Python 2.7.18
> 
> 

> Currently, an "apt-get reinstall python3-reportbug" succeeds.

Good!

> So, somewhere in the upgrade from ascii to chimaera, python3-reportbug was
> installed while python2 was still used.  Caused by skipping Beowulf?

Ah, yes. That is definitely *not* supported. You are not supposed to miss out a
release[1] for exactly this sort of reason. Python versions and packaging are
quite fragile and you can end up with mismatches. For example, python-minimal
doesn't exist in chimaera at all.

I can't reproduce your behaviour on a correctly installed ceres or chimaera
system, so I am going to tag it invalid an close.

Please feel free to reopen if you really think there is a reportbug issue.

Thanks

Mark

[1]  https://unix.stackexchange.com/questions/542459/upgrade-debian-jessie-8-to-buster-10-possible-or-need-to-go-sequential-in-ve

---

From: [email-masked] (Devuan Bug Tracking System)
Date: Sat, 05 Dec 2020 20:33:06 +0000

This is an automatic notification regarding your bug report
which was filed against the python3-reportbug version: 7.8.0+devuan1 severity: grave package:

#528: python3-reportbug: fails to install due to syntax error

It has been closed by Mark Hindley <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mark Hindley <[email-masked]> by
replying to this email.

-- 
528: https://bugs.devuan.org/cgi/bugreport.cgi?bug=528
Devuan Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#528: python3-reportbug: fails to install due to syntax error
From: Mark Hindley <[email-masked]>
To: "Gerard H. Pille" <[email-masked]>
Cc: [email-masked]
Date: Sat, 5 Dec 2020 20:26:16 +0000

Control: tags -1 invalid
Control: close -1

Good!

Thanks

Mark

Subject: python3-reportbug: fails to install due to syntax error
From: "Gerard H. Pille" <[email-masked]>
To: Devuan Bug Tracking System <[email-masked]>
Date: Sat, 5 Dec 2020 00:03:34 +0100

Dear Maintainer,

---

From: [email-masked]
Date: Sun, 6 Dec 2020 07:39:57 +1100

> On 6 Dec 2020, at 04:02, Mark Hindley <[email-masked]> wrote:
> 
> Gerard,
> 

Mark,

Another possibility is that f-strings weren’t introduced to python until version 3.6 while ascii only has version 3.5. Maybe python3-reportbug is trying to run a script somewhere before the system has upgraded the python3 interpreter?

I also noticed that the python3-reportbug package in chimaera doesn’t have a version restriction for >python3.6 so it’s possible to upgrade that package without upgrading the main python3 package which could lead to this problem.

Tom