Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 619700 - net-irc/irker-2.18 fails with python3
Summary: net-irc/irker-2.18 fails with python3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick Lauer
URL: https://github.com/gentoo/gentoo/pull...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-25 21:31 UTC by Bertrand Jacquin
Modified: 2018-07-03 19:41 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Jacquin 2017-05-25 21:31:16 UTC
When installing net-irc/irker-2.18 with PYTHON_SINGLE_TARGET="python3_4" as per:

[ebuild  N    ~] net-irc/irker-2.18::gentoo  USE="-socks5" PYTHON_SINGLE_TARGET="python3_4 -python2_7 -python3_5" PYTHON_TARGETS="python2_7 python3_4 -python3_5" 44 KiB


irk and irkerhook.py are failing to launch due to python3 incompatibility:

$ /usr/bin/irk
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/irk", line 52, in <module>
    main()
  File "/usr/lib/python-exec/python3.4/irk", line 40, in main
    target = sys.argv[1]
IndexError: list index out of range

$ /usr/bin/irkerhook.py
  File "/usr/lib/python-exec/python3.4/irkerhook.py", line 482
    print message
                ^
SyntaxError: Missing parentheses in call to 'print'

https://github.com/gentoo/gentoo/pull/4760 is an attempt to fix this behaviour by removing python3 support

Reproducible: Always
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-06-03 10:35:24 UTC
(In reply to Bertrand Jacquin from comment #0)
> When installing net-irc/irker-2.18 with PYTHON_SINGLE_TARGET="python3_4" as
> per:
> 
> [ebuild  N    ~] net-irc/irker-2.18::gentoo  USE="-socks5"
> PYTHON_SINGLE_TARGET="python3_4 -python2_7 -python3_5"
> PYTHON_TARGETS="python2_7 python3_4 -python3_5" 44 KiB
> 
> 
> irk and irkerhook.py are failing to launch due to python3 incompatibility:
> 
> $ /usr/bin/irk
> Traceback (most recent call last):
>   File "/usr/lib/python-exec/python3.4/irk", line 52, in <module>
>     main()
>   File "/usr/lib/python-exec/python3.4/irk", line 40, in main
>     target = sys.argv[1]
> IndexError: list index out of range
> 

This is actually not related to Python version at all.
Comment 2 Bertrand Jacquin 2017-07-05 21:31:31 UTC
(In reply to Michał Górny from comment #1)
> (In reply to Bertrand Jacquin from comment #0)
> > When installing net-irc/irker-2.18 with PYTHON_SINGLE_TARGET="python3_4" as
> > per:
> > 
> > [ebuild  N    ~] net-irc/irker-2.18::gentoo  USE="-socks5"
> > PYTHON_SINGLE_TARGET="python3_4 -python2_7 -python3_5"
> > PYTHON_TARGETS="python2_7 python3_4 -python3_5" 44 KiB
> > 
> > 
> > irk and irkerhook.py are failing to launch due to python3 incompatibility:
> > 
> > $ /usr/bin/irk
> > Traceback (most recent call last):
> >   File "/usr/lib/python-exec/python3.4/irk", line 52, in <module>
> >     main()
> >   File "/usr/lib/python-exec/python3.4/irk", line 40, in main
> >     target = sys.argv[1]
> > IndexError: list index out of range
> > 
> 
> This is actually not related to Python version at all.

Maybe, but it works fine using python2.7
Comment 3 Patrice Clement gentoo-dev 2017-10-08 23:08:39 UTC
I think this change is legit. Why hasn't the PR been merged already?
Comment 4 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-10-10 00:37:37 UTC
Looking at the code for irkerhook.py:

1. Upstream do work to make Py3 work.
2. Code in question is in a "debug" branch"
https://gitlab.com/laurentbachelier/irker/blame/master/irkerhook.py#L484
3. That code only fires when ship(  , , debug = true )
https://gitlab.com/laurentbachelier/irker/blame/master/irkerhook.py#L437
4. ship ( ) is only called in one place where it might pass something true
https://gitlab.com/laurentbachelier/irker/blame/master/irkerhook.py#L547
5. that path should only be trigger-able when passed an argument of -n
https://gitlab.com/laurentbachelier/irker/blame/master/irkerhook.py#L524

Did you actually pass -n to get this result?

https://gitlab.com/laurentbachelier/irker/blob/master/irkerhook.py#L8-12



Looking at /usr/bin/irk:

It Expects arguments : 
https://gitlab.com/laurentbachelier/irker/blob/master/irk#L4
https://gitlab.com/laurentbachelier/irker/blob/master/irk#L40

However, in your demonstration with a traceback, you didn't pass arguments.

Perhaps it "works" on earlier pythons by not failing when you fail to pass required arguments?
Comment 5 Bertrand Jacquin 2017-10-10 00:57:53 UTC
(In reply to Kent Fredric (IRC: kent\n) from comment #4)
> Looking at the code for irkerhook.py:
> 
> 1. Upstream do work to make Py3 work.

Indeed, but development upstream have been a bit stale recently. Current code is not fully Python 3 as demonstrated earlier

> 2. Code in question is in a "debug" branch"
> https://gitlab.com/laurentbachelier/irker/blame/master/irkerhook.py#L484

I'm not sure https://gitlab.com/laurentbachelier is the right git repository to look at. As far as I'm aware, it's hosted on https://gitlab.com/esr/irker, see http://www.catb.org/esr/irker/

> 5. that path should only be trigger-able when passed an argument of -n
> https://gitlab.com/laurentbachelier/irker/blame/master/irkerhook.py#L524
> 
> Did you actually pass -n to get this result?

I am not using -n to any of irker invocation I do, but I believe the code should fully work on a python implementation before gentoo enable a package with this python implementation.

> Looking at /usr/bin/irk:
> 
> It Expects arguments : 
> https://gitlab.com/laurentbachelier/irker/blob/master/irk#L4
> https://gitlab.com/laurentbachelier/irker/blob/master/irk#L40
> 
> However, in your demonstration with a traceback, you didn't pass arguments.

True, this is still not a reason for giving errors to users such as IndexError when it works fine with python2

> Perhaps it "works" on earlier pythons by not failing when you fail to pass
> required arguments?

Exactly
Comment 6 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-10-10 01:18:52 UTC
(In reply to Bertrand Jacquin from comment #5)
> (In reply to Kent Fredric (IRC: kent\n) from comment #4)
> > Looking at the code for irkerhook.py:
> > 
> > 1. Upstream do work to make Py3 work.
> 
> Indeed, but development upstream have been a bit stale recently. Current
> code is not fully Python 3 as demonstrated earlier

That's probably not good grounds to *remove* python3 support though, I'd probably be more interested in patches that fix known issues with python3.

Given you can get around the major problems by using it as intended, doesn't seem useful to kill it off for people who don't have problems.

That is, we should be aiming to make it better, not aiming to make it worse.

> 
> > 2. Code in question is in a "debug" branch"
> > https://gitlab.com/laurentbachelier/irker/blame/master/irkerhook.py#L484
> 
> I'm not sure https://gitlab.com/laurentbachelier is the right git repository
> to look at. As far as I'm aware, it's hosted on
> https://gitlab.com/esr/irker, see http://www.catb.org/esr/irker/

Yeah, that's how I got to this. Stupid gitlab made me jump streams as I was tracing blame somehow. Fortunately esr's HEAD is not significantly different here.

> > 5. that path should only be trigger-able when passed an argument of -n
> > https://gitlab.com/laurentbachelier/irker/blame/master/irkerhook.py#L524
> > 
> > Did you actually pass -n to get this result?
> 
> I am not using -n to any of irker invocation I do, but I believe the code
> should fully work on a python implementation before gentoo enable a package
> with this python implementation.
> 
> > Looking at /usr/bin/irk:
> > 
> > It Expects arguments : 
> > https://gitlab.com/laurentbachelier/irker/blob/master/irk#L4
> > https://gitlab.com/laurentbachelier/irker/blob/master/irk#L40
> > 
> > However, in your demonstration with a traceback, you didn't pass arguments.
> 
> True, this is still not a reason for giving errors to users such as
> IndexError when it works fine with python2
> 
> > Perhaps it "works" on earlier pythons by not failing when you fail to pass
> > required arguments?
> 
> Exactly

How well does it work? Looking at the code I'd imagine you'd have possible silently breakage further down.

Like, silently trying to send a message without knowing which channel to send it to, or which message to send, doesn't sound great.

If anything, an argument could be made that all python versions are broken in some regard.

So a patch that improves the situation on all pythons would go far :)
Comment 7 Bertrand Jacquin 2017-10-10 01:27:15 UTC
(In reply to Kent Fredric (IRC: kent\n) from comment #6)
> (In reply to Bertrand Jacquin from comment #5)
> > (In reply to Kent Fredric (IRC: kent\n) from comment #4)
> > > Looking at the code for irkerhook.py:
> > > 
> > > 1. Upstream do work to make Py3 work.
> > 
> > Indeed, but development upstream have been a bit stale recently. Current
> > code is not fully Python 3 as demonstrated earlier
> 
> That's probably not good grounds to *remove* python3 support though, I'd
> probably be more interested in patches that fix known issues with python3.
> 
> Given you can get around the major problems by using it as intended, doesn't
> seem useful to kill it off for people who don't have problems.

As of today, everybody with python3 as the default interpreter has the issues I reported.

> That is, we should be aiming to make it better, not aiming to make it worse.

I'm not trying to make it worse, I'm exactly trying to make it better. Bugs can still be reported upstream, but we have no insurance they will be fixed at some point. Us maintaining patches is hassle since we'll have to rebase for every single release. I may have the knowledge to enhance current code but I probably would make it worse by doing patches not reviewed upstream.

The goal here is to make things easier and more straight forward for users while not drifting from upstream too much, usually people installing a software are not reading code to know how to invoke a program, they just run it.


> > > Perhaps it "works" on earlier pythons by not failing when you fail to pass
> > > required arguments?
> > 
> > Exactly
> 
> How well does it work? Looking at the code I'd imagine you'd have possible
> silently breakage further down.

It does work perfectly with python2
Comment 8 Pacho Ramos gentoo-dev 2018-06-26 19:20:54 UTC
[master cc366a1a62e3] net-irc/irker: Doesn't work with python3 bug #619700
 1 file changed, 55 insertions(+)
 create mode 100644 net-irc/irker/irker-2.18-r1.ebuild