Red Hat Bugzilla – Bug 997165
Yum doesn't work if Python3 is made default
Last modified: 2015-02-17 11:46:06 EST
Description of problem:
Yum is not ported to Python 3 and Fedora doesn't seem to plan on that. So, please change the shebang line of yum to contain python2. I do understand that Fedora doesn't have Py3 as default now and doesn't plan to do so at least till F22. But it helps users requiring Py3 to be the default one if yum's shebang points to python2.
Here are the details of the problem:
HP Linux Imaging and Printing (hplipopensource.com) software installs it's dependencies too (if not already present) during it's installation. HPLIP uses distro standard package management (command line) utilities for downloading and installing the dependencies.
HPLIP is implementing support for Python 3, the approach for this support is making the source code compatible with both Py2 and Py3. So, we are retaining "python" in the shebang lines, which also goes well for recommendations at PEP-394 (http://www.python.org/dev/peps/pep-0394).
The problem happens when HPLIP is run using python3 as the default interpreter. Since "yum" is not ported to Py3, invocation of "yum" from HPLIP installer in this usecase (Py3 being default) fails.
I understand that there is no plan to port "yum" to Py3 and the package management utility may be DNF which is supposed to work with Py3 and that Fedora will not make Py3 default until at least F22 (http://firstname.lastname@example.org/thread/F3QOXUQSGJLFAJHIE6BY42YSW4QPRIGK/).
We have worked around this limitation on Fedora for our internal testing of Py3 support feature. But we would like a change (or a solution) from Fedora so that we do not have to keep any work-arounds. What we are looking for is,
1. to know when can we expect a package management utility on Fedora which supports both Py2 and Py3
2. Change the shebang line of "yum" and related files to contain "python2". This will be according to the recommendation at PEP-0394. With this, yum will works in either environments (Py2 & Py3) without requiring any work-arounds.
Our Py3 support is working well in all our tier-1 distros except Fedora. The change mentioned in #2 above is much required for our release qualification of the feature.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Change /usr/bin/python to point to some python3.x. (This is a usecase for us to verify things work well when/if default python is python3)
2. Run "yum"
3. You will see SyntaxErrors
Change the shebang line of yum to point to python2. So, yum will work whether the default interpreter is python2 or python3
Before anything else, let me state that *I'm not saying no* to your request. I'm just pointing out that this doesn't have a high priority for us.
(In reply to Suma Byrappa from comment #0)
> Description of problem:
> Yum is not ported to Python 3 and Fedora doesn't seem to plan on that. So,
> please change the shebang line of yum to contain python2. I do understand
> that Fedora doesn't have Py3 as default now and doesn't plan to do so at
> least till F22. But it helps users requiring Py3 to be the default one if
> yum's shebang points to python2.
I'm sorry but there are reasons why Fedora does not have Python 3 as default, this is one of them - packages are not yet ready. Please don't take this in any kind of offensive way but if you need Python 3 as default and you need it *right now*, Fedora is probably not the answer as it is not intended to run that way. Note that if user changes python default the way you do it (as described above), he is likely to have other serious issues.
> HP Linux Imaging and Printing (hplipopensource.com) software installs it's
> dependencies too (if not already present) during it's installation. HPLIP
> uses distro standard package management (command line) utilities for
> downloading and installing the dependencies.
If you are maintainer of the package, please make sure it does not do that. The *only* safe and more importantly the only *safe* way how to install dependencies is to Require them in rpm.
> The problem happens when HPLIP is run using python3 as the default
> interpreter. Since "yum" is not ported to Py3, invocation of "yum" from
> HPLIP installer in this usecase (Py3 being default) fails.
If you set Python 3 to be the default, you are probably an expert and know what you are doing and that it can break things.
> We have worked around this limitation on Fedora for our internal testing of
> Py3 support feature. But we would like a change (or a solution) from Fedora
> so that we do not have to keep any work-arounds. What we are looking for is,
> 1. to know when can we expect a package management utility on Fedora which
> supports both Py2 and Py3
Maybe with the dnf on F22 however it's a very big maybe since keeping support for Python2 is not our priority and I expect it to be there only if it kinda happens on its own.
> 2. Change the shebang line of "yum" and related files to contain "python2".
> This will be according to the recommendation at PEP-0394. With this, yum
> will works in either environments (Py2 & Py3) without requiring any
Not sure if this aligns with Fedora packaging policies, anyone who takes this bug should coordinate with Python maintainers.
1. I'm aware of Fedora's plans on Python 3 support. As I mentioned in the bug description, I'm aware that Fedora doesn't plan to make Py3 as default not before F22 release and the Py3 support work on Fedora is incremental
2. So no, I don't expect Fedora to make Py3 default "right now". It is just that we develop and maintain the project HPLIP and Fedora is among our tier-1 distributions, meaning all our release testing should go fine on Fedora too.
3. Yes, not having rpm as the default packaging for HPLIP could be a limitation. We do provide rpm package support, but that has not been the default packaging due to few reasons. I'd prefer we do not digress from the problem discussing those reasons here.
4. Yes, we know what we are doing. And fortunately, everything else except "yum" which is required for HPLIP works fine with Py3 on Fedora.
5. As I mentioned, we are working around the problem for now. But if Fedora can make yum's shebang to contain "python2", it avoid's us having to keep the work-around till Fedora provides a final solution (which can not be expected in a shorter time frame). This is in fact recommended by PEP-394 and I believe goes well for Fedora too as Fedora is also in "preparation stage" in supporting Python3.
It is a very simple change, but does have positive impact on other projects like us. Hoping to see the fix sooner.
Could you please provide me an update on this?
No update on this at the moment. As I have indicated, this is not a priority for the team. Even if it looks simple enough, it will still consume time to create the patch, commit and build it. You are more then welcome to create the patch and send it for a review on yum-devel mailing list though - that would improve your chances significantly.
In fact such a patch has been sent and briefly discussed on yum-devel (but not committed so far): http://lists.baseurl.org/pipermail/yum-devel/2013-August/010317.html
Thanks for the info Panu, I completely missed that one. In that case I guess that yum-devel is probably the place to ask for updates and/or lobby for the patch.
This message is a notice that Fedora 19 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 19. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 19 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.