Bug 963839 - newt: Add support for Python 3
Summary: newt: Add support for Python 3
Alias: None
Product: Fedora
Classification: Fedora
Component: newt
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 984907
TreeView+ depends on / blocked
Reported: 2013-05-16 16:40 UTC by Keith Hughitt
Modified: 2014-11-08 23:57 UTC (History)
4 users (show)

Fixed In Version: newt-0.52.16-2.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-12-14 03:43:28 UTC
Type: Bug

Attachments (Terms of Use)

Description Keith Hughitt 2013-05-16 16:40:08 UTC
It seems like the snack interface to libnewt is currently capable of supporting Python 3 (e.g. https://launchpad.net/ubuntu/raring/i386/python3-newt), however, at the moment, there are some python2-specific entries hard-coded into the configuration, making this difficult to achieve.

Would it be possible to add native python3 support?

Comment 1 Fedora End Of Life 2013-09-16 13:56:59 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:

Comment 2 Miro Hrončok 2013-10-01 14:29:26 UTC
If you need any extra hand with this, feel free to use me :)

Comment 3 Miro Hrončok 2013-10-02 11:35:14 UTC
Hi, we would like to use Python 3 on the default installation instead of Python 2 on Fedora 22.

From that perspective, your package is considered as IMPORTANT - that means, is has to be updated to Python 3, for our intention come true.

The goal here is, that at least for F22 you should provide python3 subpackage.

Please, help use update to Python 3 flawlessly.

Check if upstream already support Python 3, if yes, use it and add te support to the package.

If upstream doesn't support Python 3 yet, encourage it to do so by sending patches and offering your help.

When upstream is dead or unwilling to support Python 3, you'll need to patch this package on Fedora level. Try to avoid this as much as you can, but use it, if it's the last option.

Chances are, that you ARE the upstream. In that case, everything is easier, just do it yourself.

There is a table on wiki, that should list your package. Chances are, that you can see an upstream link that covers the problem. Anyway, please update the table with information you know.


I offer my help with this task, so if you have no idea, how to work on this, or it is just not your priority, don't hesitate to ask for help.

(As you've already realized, this is a bulk text, so if something is not quite exact about your package, sorry for that, just ask)

Comment 4 Keith Hughitt 2013-10-02 13:20:46 UTC

As far as I can tell, this *is* upstream :)


Comment 5 Toshio Ernie Kuratomi 2013-10-02 22:45:00 UTC
Note: do not follow this portion of the advice as it is against the Packaging Guidelines: "When upstream is dead or unwilling to support Python 3, you'll need to patch this package on Fedora level. Try to avoid this as much as you can, but use it, if it's the last option."

If you are in this situation, you'll essentially be forking upstream in order to produce a python3 port.  In that situation, the proper thing to do is to create a new package with the python3 port.  It would be even better to create the proper upstream infrastructure as well (new upstream scm and issue tracker) but that isn't 100% required by the guidelines.

Comment 6 Miroslav Lichvar 2013-10-03 08:27:20 UTC
Yes, I'm the upstream maintainer and I'll be happy to include patches adding support for Python 3. I don't have much time to work on it now.

Comment 7 Miro Hrončok 2013-10-15 14:35:00 UTC
Working on it.

Comment 8 Miro Hrončok 2013-10-16 11:31:56 UTC
OK, so the patch from Debian is working, except in Python 3 _snackmodule.so should be renamed in _snack.so.

The patch itself: http://churchyard.fedorapeople.org/newt-python3.patch
Updated spec (uses the patch): http://churchyard.fedorapeople.org/newt.spec

The spec now applies the patch and renames the .so module. The patch should be merged upstream and the renaming should be done in build mechanism (autotools), rather than in spec.

After the patch, I've tested the examples in Python 2.6 (on CentOS 6.4), Python 2.7 an 3.3 (on Fedora 19).

Assigning this back to you, so you can merge this upstream.

Comment 9 Miro Hrončok 2013-10-17 10:08:47 UTC
Ah, renaming _snackmodule.so to _snack.so also works with Python 2.7 and 2.6, so you don't need any extra condition in autotools.

So you can merge this and just change the filename of the compiled library in Makefile.in

Comment 10 Miroslav Lichvar 2013-10-17 16:17:24 UTC
The patches are now with some minor modifications in the upstream git. In Fedora, the support is included in newt-0.52.16-2.fc20.

Miro, thanks for preparing the patches. Thanks to Matthias Klose for the original patch.

Comment 11 Fedora Update System 2013-10-17 16:19:42 UTC
newt-0.52.16-2.fc20 has been submitted as an update for Fedora 20.

Comment 12 Fedora Update System 2013-10-17 20:32:11 UTC
Package newt-0.52.16-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing newt-0.52.16-2.fc20'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2013-12-14 03:43:28 UTC
newt-0.52.16-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Keith Hughitt 2013-12-14 12:06:21 UTC
Great. Thanks for tackling this!

Note You need to log in before you can comment on or make changes to this bug.