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
(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.
(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
I think this change is legit. Why hasn't the PR been merged already?
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?
(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
(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 :)
(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
[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