View Revisions: Issue #11

Summary 0000011: [PATCH] guicast/bccmdl.py is not Python 3 compatible
Revision 2018-12-04 05:52 by ferdnyc
Description I sent this to [email protected] earlier today, before I'd seen the announcement about the new site. Since it still hasn't posted to the mailing list yet, and since it really more concerns Cinelerra-GG, I thought I'd duplicate it here as well.
=========================
The rpmfusion third-party package repository for Fedora Linux is working on packaging the latest Cinelerra-GG for inclusion:

https://bugzilla.rpmfusion.org/show_bug.cgi?id=5093

The package reviewer quite correctly flagged the dependency on Python 2 in `guicast/bccmdl.py` as a concern, since Fedora is in the process of deprecating Python 2 entirely and it's highly desirable that all remaining uses of Python throughout the distro have support for Python 3.

In the case of `guicast/bccmdl.py`, the only Python 3 incompatibilities were the `print` statements which use deprecated
Python 2 semantics.

The attached patch updates those all to Python 3 `print()` function form, retaining compatibility with Python 2 via an added instruction at the start of the file:

from __future__ import print_function

It also updates the Makefile in the `guicast` directory, to invoke the script via `python3 < bccmdl.py`
Revision 2018-12-06 20:26 by Sam
Description I sent this to [email protected] earlier today, before I'd seen the announcement about the new site. Since it still hasn't posted to the mailing list yet, and since it really more concerns Cinelerra-GG, I thought I'd duplicate it here as well.
=========================
The rpmfusion third-party package repository for Fedora Linux is working on packaging the latest Cinelerra-GG for inclusion:

https://bugzilla.rpmfusion.org/show_bug.cgi?id=5093

The package reviewer quite correctly flagged the dependency on Python 2 in `guicast/bccmdl.py` as a concern, since Fedora is in the process of deprecating Python 2 entirely and it's highly desirable that all remaining uses of Python throughout the distro have support for Python 3.

In the case of `guicast/bccmdl.py`, the only Python 3 incompatibilities were the `print` statements which use deprecated
Python 2 semantics.

The attached patch updates those all to Python 3 `print()` function form, retaining compatibility with Python 2 via an added instruction at the start of the file:

from __future__ import print_function

It also updates the Makefile in the `guicast` directory, to invoke the script via `python3 < bccmdl.py`
Revision 2018-12-04 05:52 by ferdnyc
Additional Information The patched bccmdl.py, whether run in Python 2 or Python 3, produces a set of files completely identical to the files output by the unpatched version when executed as python2.7 < bccmdl.py.


$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

$ python2.7 < bccmdl.py; cp -Rp xfer xfer-old

$ git checkout bccmdl-py3

$ python3 < bccmdl.py; cp -Rp xfer xfer-newpy3

$ python2.7 < bccmdl.py; cp -Rp xfer xfer-newpy2

$ diff -rq xfer-old xfer-newpy3; echo $?
0

$ diff -rq xfer-old xfer-newpy2; echo $?
0

Revision 2018-12-06 20:26 by Sam
Additional Information The patched bccmdl.py, whether run in Python 2 or Python 3, produces a set of files completely identical to the files output by the unpatched version when executed as python2.7 < bccmdl.py.


$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

$ python2.7 < bccmdl.py; cp -Rp xfer xfer-old

$ git checkout bccmdl-py3

$ python3 < bccmdl.py; cp -Rp xfer xfer-newpy3

$ python2.7 < bccmdl.py; cp -Rp xfer xfer-newpy2

$ diff -rq xfer-old xfer-newpy3; echo $?
0

$ diff -rq xfer-old xfer-newpy2; echo $?
0