You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I maintain the FreeBSD port of grc and I'm busy updating our package to v1.11.
I noticed that the README states that grc has python2 + python3 compatibility.
The python3 in the shebang is not a problem, we replace that with the python interpreter of the user's choosing.
However, in commit 1516a3e the python3-only FileNotFoundError was introduced. This gives the following error on python2:
# grc foo
Traceback (most recent call last):
File "/usr/local/bin/grc", line 193, in <module>
except FileNotFoundError:
NameError: name 'FileNotFoundError' is not defined
Besides the try-except part, grc seems to still run fine on python2 otherwise.
I would like not forcing users to install python3, so I would prefer to change the try-except in grc to something like this, which would work in python2/3 and still be mostly informative I think:
Alternatively, if grc will support python3 only, this doesn't need to be changed (but the README would); in that case I might either patch it downstream for python2 users or I would just require python3 as a dependency.
The text was updated successfully, but these errors were encountered:
Good catch - I haven't noticed this while testing, because the nonexistent exception is invoked only if you run grc with an invalid command. I slightly modified your solution, since I prefer to have a full debug output if there is any other problem apart from OSError. I'll probably make a new fix-up release soon.
Yes, I'd very much prefer grc to work with python2 as well.
Hi, I maintain the FreeBSD port of grc and I'm busy updating our package to v1.11.
I noticed that the README states that grc has python2 + python3 compatibility.
The
python3
in the shebang is not a problem, we replace that with the python interpreter of the user's choosing.However, in commit 1516a3e the python3-only
FileNotFoundError
was introduced. This gives the following error on python2:Besides the try-except part, grc seems to still run fine on python2 otherwise.
I would like not forcing users to install python3, so I would prefer to change the try-except in grc to something like this, which would work in python2/3 and still be mostly informative I think:
Other solutions would be welcome too.
Alternatively, if grc will support python3 only, this doesn't need to be changed (but the README would); in that case I might either patch it downstream for python2 users or I would just require python3 as a dependency.
The text was updated successfully, but these errors were encountered: