Bug 16524 - Adapting msec to python 3
Summary: Adapting msec to python 3
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal enhancement
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-02 08:25 CEST by papoteur
Modified: 2015-08-29 00:27 CEST (History)
4 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
Adaptation to python 3 (36.27 KB, patch)
2015-08-02 08:30 CEST, papoteur
Details | Diff
convert to python3 (32.23 KB, patch)
2015-08-02 19:31 CEST, Thierry Vignaud
Details | Diff
adapt shebang (3.13 KB, patch)
2015-08-02 19:31 CEST, Thierry Vignaud
Details | Diff
python3 fix (609 bytes, patch)
2015-08-02 19:31 CEST, Thierry Vignaud
Details | Diff
bump release (725 bytes, patch)
2015-08-02 19:32 CEST, Thierry Vignaud
Details | Diff
2to3-3.4 modifications (31.76 KB, patch)
2015-08-04 20:29 CEST, papoteur
Details | Diff
Adaption of shebang (5.38 KB, patch)
2015-08-04 20:30 CEST, papoteur
Details | Diff
Adapting gettext install command (5.17 KB, patch)
2015-08-04 20:31 CEST, papoteur
Details | Diff
the other modifications (4.89 KB, patch)
2015-08-04 20:32 CEST, papoteur
Details | Diff
Syntax corrections (1.59 KB, patch)
2015-08-07 07:37 CEST, papoteur
Details | Diff
Suppression of a decode instruction (832 bytes, patch)
2015-08-12 23:08 CEST, papoteur
Details | Diff
Reverse the Narg function (15.96 KB, patch)
2015-08-14 13:41 CEST, papoteur
Details | Diff

Description papoteur 2015-08-02 08:25:39 CEST
Description of problem:
msec is written in python 2
Migration to python 3 hoped.
I propose a patch for that.




Reproducible: 

Steps to Reproduce:
Comment 1 papoteur 2015-08-02 08:30:12 CEST
Created attachment 6881 [details]
Adaptation to python 3

I tested the modifications in msecgui and with make and make install.
Marja Van Waes 2015-08-02 17:28:03 CEST

CC: (none) => makowski.mageia, marja11, neoclust, thierry.vignaud

Comment 2 Thierry Vignaud 2015-08-02 19:31:29 CEST
Created attachment 6883 [details]
convert to python3
Comment 3 Thierry Vignaud 2015-08-02 19:31:41 CEST
Created attachment 6884 [details]
adapt shebang
Comment 4 Thierry Vignaud 2015-08-02 19:31:54 CEST
Created attachment 6885 [details]
python3 fix
Comment 5 Thierry Vignaud 2015-08-02 19:32:06 CEST
Created attachment 6886 [details]
bump release
Comment 6 Thierry Vignaud 2015-08-02 19:35:03 CEST
We definitively want to migrate to python3.
For the record, here's the work I did one year ago (rebased on top of current master).
I let you compare both approach.
One difference is for the python3 fix. WDYT? What's better your fix or mine?

We could use your patch as it was tested recently (though you could split the shebang part like I did in order to have smaller easier-to-reread-in-6-months commits.
I would also split the "header =" as it's a manual fix.
WDYT?
Comment 7 Philippe Makowski 2015-08-02 20:46:16 CEST
(In reply to Thierry Vignaud from comment #6)
> We could use your patch as it was tested recently (though you could split
> the shebang part like I did in order to have smaller
> easier-to-reread-in-6-months commits.
> I would also split the "header =" as it's a manual fix.
> WDYT?

agree with that
Comment 8 papoteur 2015-08-02 22:42:37 CEST
Ok, I will submit it in parts.
Thierry, in your patch, the class ConfigFile is badly indented.
I added also modifications in gettext.install suppressing unicode parameter.
Thus, scripts in plugins are also concerned.
Comment 9 Thierry Vignaud 2015-08-02 22:47:48 CEST
as I said, I'm fine with going your way :-)
Comment 10 papoteur 2015-08-04 20:29:28 CEST
Created attachment 6898 [details]
2to3-3.4 modifications
Comment 11 papoteur 2015-08-04 20:30:24 CEST
Created attachment 6899 [details]
Adaption of shebang
Comment 12 papoteur 2015-08-04 20:31:47 CEST
Created attachment 6900 [details]
Adapting gettext install command
Comment 13 papoteur 2015-08-04 20:32:58 CEST
Created attachment 6901 [details]
the other modifications

The last ones, for the moment.
Comment 14 Thierry Vignaud 2015-08-04 20:49:49 CEST
Comment on attachment 6901 [details]
the other modifications

If we don't need Narg() anymore b/c everything is eventually UTF-8, just kill it.
But we'd better check with other languages (see bug #13837)
Comment 15 papoteur 2015-08-04 21:37:45 CEST
Yes, I think also that it should be cleaned. If it works for all languages.
I already tested pt_BR and fr.
I would have some back advices before processing.
Comment 16 Thierry Vignaud 2015-08-04 22:12:34 CEST
Too bad we introduced Narg() just a couple days before :-(
Comment 17 papoteur 2015-08-07 07:37:27 CEST
Created attachment 6913 [details]
Syntax corrections

I discover some syntax problems with string.replace, string.join and os.error in libsec.py

Attachment 6881 is obsolete: 0 => 1

Comment 18 papoteur 2015-08-12 23:08:17 CEST
Created attachment 6922 [details]
Suppression of a decode instruction

Another syntax error
Comment 19 papoteur 2015-08-14 13:41:49 CEST
Created attachment 6928 [details]
Reverse the Narg function

WHat a pitty, we should reverse this work/
Comment 20 Mageia Robot 2015-08-28 19:58:49 CEST
commit 73a2738eba0625fa9befcaeed690e035b12ab91e
Author: SARL ENR 68 <david@...>
Date:   Fri Aug 28 19:58:30 2015 +0200

    Adaptation to python3 using 2to3-3.4 (mga#16524)
    
    - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6898
---
 Commit Link:
   http://gitweb.mageia.org/software/msec/commit/?id=73a2738eba0625fa9befcaeed690e035b12ab91e
Comment 21 Mageia Robot 2015-08-28 20:03:25 CEST
commit d12860fd59555360c5bec904112af054da2e9f76
Author: SARL ENR 68 <david@...>
Date:   Fri Aug 28 20:03:09 2015 +0200

    Adapt shebang (mga#16524)
    
    - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6899
---
 Commit Link:
   http://gitweb.mageia.org/software/msec/commit/?id=d12860fd59555360c5bec904112af054da2e9f76
Comment 22 Mageia Robot 2015-08-28 20:05:14 CEST
commit 790687cc86370e6f672654b3ab76d5a1fad41bf1
Author: SARL ENR 68 <david@...>
Date:   Fri Aug 28 20:04:58 2015 +0200

    Adjust gettext.install for python3 (mga#16524)
    
    - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6900
---
 Commit Link:
   http://gitweb.mageia.org/software/msec/commit/?id=790687cc86370e6f672654b3ab76d5a1fad41bf1
Comment 23 Mageia Robot 2015-08-28 20:06:45 CEST
commit a3a185fdf46f25d4c8321b478427cc14987d62db
Author: SARL ENR 68 <david@...>
Date:   Fri Aug 28 20:06:30 2015 +0200

    Other modifications for pyhton adapting to Python3 (mga#16524)
    
    - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6901
---
 Commit Link:
   http://gitweb.mageia.org/software/msec/commit/?id=a3a185fdf46f25d4c8321b478427cc14987d62db
Comment 24 Mageia Robot 2015-08-28 20:08:26 CEST
commit 0e0672380f7db341e3966906b9fa73d16b4f49a8
Author: SARL ENR 68 <david@...>
Date:   Fri Aug 28 20:08:12 2015 +0200

    Syntax corrections for string replace, join and for os.error (mga#16524)
    
    - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6913
---
 Commit Link:
   http://gitweb.mageia.org/software/msec/commit/?id=0e0672380f7db341e3966906b9fa73d16b4f49a8
Comment 25 Mageia Robot 2015-08-28 20:09:43 CEST
commit 3cca390baa91f14bb8f112587bf62388dbad66b8
Author: SARL ENR 68 <david@...>
Date:   Fri Aug 28 20:09:28 2015 +0200

    Suppress a decode instruction (mga#16524)
    
    - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6922
---
 Commit Link:
   http://gitweb.mageia.org/software/msec/commit/?id=3cca390baa91f14bb8f112587bf62388dbad66b8
Comment 26 Mageia Robot 2015-08-28 20:11:01 CEST
commit 71c7542f490e69f94b2a5277b40f4072a0fc7ad5
Author: SARL ENR 68 <david@...>
Date:   Fri Aug 28 20:10:47 2015 +0200

    Reverse the Narg function, no more needed (mga#16524)
    
    - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6928
---
 Commit Link:
   http://gitweb.mageia.org/software/msec/commit/?id=71c7542f490e69f94b2a5277b40f4072a0fc7ad5
Comment 27 Thierry Vignaud 2015-08-29 00:27:52 CEST
Closing

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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