On Wed, 24 Feb 2021 19:41:08 +0100 Sven Mueller <sven.muelle...@gmail.com> wrote: > Am Mi., 24. Feb. 2021 um 19:34 Uhr schrieb Jonas Smedegaard <jo...@jones.dk
> >:
>
> > severity -1 normal
> >
> > Hi Sven,
> >
> > Quoting Sven Mueller (2021-02-24 19:02:41)
> > > /usr/lib/cdbs/waf-unpack is using /usr/bin/python and it's syntax is
> > > Python 2 only.
> > > I have no clue what a WAF is, so I didn't spend time trying to fix
> > > this issue, sorry.
> > >
> > > Marking as serious as Python 2.7 is EOL and
> > > https://wiki.debian.org/Python/2Removal clearly says that packages are
> > > not allowed to rely on it.
> > > cdbs also doesn't depend on python-is-python2, which could be argued
> > > to allow this usage, so it is actually broken in Bullseye.
> >
> > Severity serious is appropriate for any packages actually using that
> > waf-unpack script, but not for CDBS offering that script.
> >
>
> I'd argue that the Python/2Removal doc clearly says that packages must not
> rely on /usr/bin/python.
> (And yes, there is a phrase in there particularly for packages needing it
> for
> their build process, but cdbs doesn't need it for the build process but to
> provide
> functionality for other packages to build.)
>
> As such, the bug to fix is in cdbs (don't use Python 2.7). And as far as I
> understood
> the discussions, the removal of Python 2 is basically a policy change, so
> using it
> would be a policy violation.
>
>
> > At least that's my personal opinion - the CDBS maintainers obviously
> > have the final say on this...¹
> >
>
> Well, yes, but I wonder if it is worth even discussing. The script is short
> enough that
> someone who knows what it should do can fix it quickly and verify that it
> still works,
> faster than this discussion could be resolved :-)

As far as I can see, the script is mostly Python 3 compatible, except for the 3 print statements at the end of the file.

So with this trivial patch, the issue could be solved:

diff --git a/scripts/waf-unpack b/scripts/waf-unpack
index d0309f2..db6b970 100755
--- a/scripts/waf-unpack
+++ b/scripts/waf-unpack
@@ -115,11 +115,11 @@ if __name__ == '__main__':
        (options, args) = parser.parse_args()

        if not options.waf and not options.dest:
-               print '--waf and --dest options are mandatory'
+               print('--waf and --dest options are mandatory')
                parser.print_help()
                sys.exit(1)

-       print 'Unpacking ' + options.waf + ' to ' + options.dest + ' ...'
+       print('Unpacking ' + options.waf + ' to ' + options.dest + ' ...')
        unpack_waf(options.waf, options.dest)
-       print 'Done'
+       print('Done')

Claude

Reply via email to