GNOME Bugzilla – Bug 758490
Please make caribou compatible with python3
Last modified: 2015-12-02 01:00:40 UTC
It would be nice if caribou was working with python3
On F23 the spec file is calling 2to3 during the build, I guess that most of the changes can already be integrated in the main source code while it stays compatible with python2
Do you encounter any problem, actually? I'm not sure about the rationale for calling 2to3 from the F23 spec, but afaict all the included python scripts are compatible with python3 (see bug 690962 comment 12). All you need is to properly set $PYTHON to a python3 interpreter when building.
Created attachment 316140 [details] [review]
Add some code compatibility for python3
It is seen that on Fedora Caribou rpm build failed for python3. If used 2to3 tool everything works fine, but if I remove it then build fails. I tried to find minimal changes required in code compared to what 2to3 tool is offering changes. With this attached patch build on Fedora for python3 should succeed without 2to3 tool.
Thanks Parag for the patch. Apparently Fedora's rpm-build does stricter checking when byte compiling installed files, than Automake.
Review of attachment 316140 [details] [review]:
(pushed as 067cf731)
for i in $(find . -name '*.py'); do python3 -m py_compile $i; done
This command returns no error any more, so syntax wise it should be OK
But the 2to3 scripts still returns some changes, one seems to be related to unicode/non-unicode characters:
- return unichr(int(m.group(1), 16))
+ return chr(int(m.group(1), 16))
(In reply to Laurent Bigonville from comment #5)
> - return unichr(int(m.group(1), 16))
> + return chr(int(m.group(1), 16))
This seems to be a false-positive, since one line above it checks if 'unichr' is defined.
I'm closing this as a duplicate of the original python3 porting bug. Feel free to reopen it if you see a real problem.
*** This bug has been marked as a duplicate of bug 690962 ***