After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758490 - Please make caribou compatible with python3
Please make caribou compatible with python3
Status: RESOLVED DUPLICATE of bug 690962
Product: caribou
Classification: Applications
Component: default
git master
Other Linux
: Normal normal
: ---
Assigned To: caribou-maint
caribou-maint
Depends on:
Blocks:
 
 
Reported: 2015-11-22 10:34 UTC by Laurent Bigonville
Modified: 2015-12-02 01:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add some code compatibility for python3 (2.52 KB, patch)
2015-11-24 06:50 UTC, Parag AN
committed Details | Review

Description Laurent Bigonville 2015-11-22 10:34:39 UTC
Hi,

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
Comment 1 Daiki Ueno 2015-11-24 01:49:48 UTC
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.
Comment 2 Parag AN 2015-11-24 06:50:14 UTC
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.
Comment 3 Daiki Ueno 2015-11-24 07:38:57 UTC
Thanks Parag for the patch.  Apparently Fedora's rpm-build does stricter checking when byte compiling installed files, than Automake.
Comment 4 Daiki Ueno 2015-11-24 07:41:16 UTC
Review of attachment 316140 [details] [review]:

(pushed as 067cf731)
Comment 5 Laurent Bigonville 2015-11-24 09:04:28 UTC
Thanks

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))
Comment 6 Daiki Ueno 2015-11-24 09:21:00 UTC
(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.
Comment 7 Daiki Ueno 2015-12-02 01:00:40 UTC
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 ***