Bug 1659268 - mc depends on python2 and thus on openssl10
Summary: mc depends on python2 and thus on openssl10
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1738081 (view as bug list)
Depends On:
Blocks: F31_PY2REMOVAL
TreeView+ depends on / blocked
 
Reported: 2018-12-13 23:23 UTC by Dominik 'Rathann' Mierzejewski
Modified: 2019-09-28 15:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-28 15:24:12 UTC


Attachments (Terms of Use)
Python3 patch for s3+ generated by 2to3 (1.92 KB, patch)
2019-09-20 14:52 UTC, Jan ONDREJ
no flags Details | Diff

Description Dominik 'Rathann' Mierzejewski 2018-12-13 23:23:45 UTC
Description of problem:
mc is the only package still requiring python2 and thus openssl10 on my F29 VM. Please switch to python3 at least in F30+.

Version-Release number of selected component (if applicable):
mc-1:4.8.21-2.fc29.x86_64

How reproducible:
Always

Steps to Reproduce:
1. rpm -qR mc |grep python

Actual results:
/usr/bin/python2

Expected results:
/usr/bin/python3

Additional info:
This will help implement: https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal

Comment 1 Tomasz Kłoczko 2018-12-14 04:30:08 UTC
mc python code is abut s3 bucket vfs.
I have ability to use AWS now.

If someone will submit the patch I can quickly add it to mc package.

Comment 2 Tomasz Kłoczko 2019-02-05 02:09:06 UTC
Did you had chance to port s3 vfs backends script to python 3.x?

Comment 3 Jan ONDREJ 2019-05-11 11:36:10 UTC
Looks like not only s3+, but also uc1541 is pyton2 script only.

s3+ can be ported to python3 using 2to3 script. It can start, but I have no AWS account to test.

uc1541 is more complicated. Uses ArgumentParser().func, which is not implmented in python3 arg parser. It is possible to disable argparse module and then uc1541 switches to simple no_parse mode. Not sure, how much functionality is disabled after this change.

May be it would be good to move these plugins and may be others, which requires external programs to a different optional subpackage.

Comment 4 Jan ONDREJ 2019-05-11 17:10:59 UTC
Looks like uc1541 python3 support is already available upstream:

https://bitbucket.org/gryf/uc1541/src/master/

and as I already wrote, s3+ can be ported using:

2to3 -w s3+

There is a ticket open in mc upstream for python3 porting too:

http://midnight-commander.org/ticket/3936

Comment 5 Tomasz Kłoczko 2019-05-11 23:08:44 UTC
I have no possibility to test s3 support.
Please let me know does it work after update using 2to3.

Comment 6 Jan ONDREJ 2019-05-13 12:14:57 UTC
Meybe sombody on mc upstream can test s3+.
Is there anybody, who can update upstream bug to inform about 2to3 testing?

Comment 7 Ben Cotton 2019-08-13 17:10:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 8 Ben Cotton 2019-08-13 19:20:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 9 Jindrich Novy 2019-08-22 13:50:28 UTC
The s3+ and uc1541 needs porting to python3. This is what happens when I run it with python3 shebang in mc-4.8.23:

$ ./s3+
  File "./s3+", line 199
    raise res[0],res[1],res[2]
                ^
SyntaxError: invalid syntax

$ ./uc1541
Traceback (most recent call last):
  File "./uc1541", line 556, in <module>
    sys.exit(PARSE_FUNC())
  File "./uc1541", line 514, in parse_args
    return args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'

Comment 10 Jindrich Novy 2019-08-22 13:51:18 UTC
*** Bug 1738081 has been marked as a duplicate of this bug. ***

Comment 11 Tomasz Kłoczko 2019-08-22 20:53:20 UTC
Feel free to send the patch.
I'm not using AWS.

Comment 12 Lumír Balhar 2019-08-30 05:55:09 UTC
Any news here? One possible solution might be to remove these plugins from mc of move them to optional subpackage and request a fesco exception for it.

Porting of S3 plugin should be simple because it's only ~500 LOC but we need to find somebody who will be able to test it.

Comment 13 Tomasz Kłoczko 2019-09-01 07:26:44 UTC
I'm not using AWS so feel free to send patch.

Comment 14 Lumír Balhar 2019-09-09 07:40:06 UTC
Would you mind to send an email to devel@ mailing list? I am sure that we can find somebody there who would be able to test it.

Comment 15 Lumír Balhar 2019-09-16 18:50:39 UTC
What is your plan?

Comment 16 Tomasz Kłoczko 2019-09-20 13:25:20 UTC
Feel free to upload the patch for python3 for s3 vfs extension.
I'm not using AWS.

Comment 17 Jan ONDREJ 2019-09-20 14:52:14 UTC
Created attachment 1617222 [details]
Python3 patch for s3+ generated by 2to3

Looks like we are still moving in circle. Adding a patch for s3+. This patch has not been testing, but I think, the only way how to test it is to add it to Fedora's mc. May be nobody is using this and it's not needed anymore. This patch is simple, generated by python's 2to3, so it should work.

Comment 18 Jindrich Novy 2019-09-20 14:59:33 UTC
Hi Jan,

thanks for this! Do you mind looking at uc1541 script as well? Ideally if you do a PR in upstream so that all distros could have it -> 
https://midnight-commander.org/

Thanks,
Jindrich

Comment 19 Jan ONDREJ 2019-09-20 15:09:32 UTC
Hello Jindrich

(In reply to Jindrich Novy from comment #18)
> thanks for this! Do you mind looking at uc1541 script as well?

Please, look at my comment #4. There was anything required already written in may 2019.
Looks like there is a still maintained python3 version of uc1541 at bitbucket.

> Ideally if
> you do a PR in upstream so that all distros could have it -> 
> https://midnight-commander.org/

Sorry, no time now to do this. I think you are a mc developer, so please do it instead of me. It's very easy to generate this patch, just use a part of base devel python3 skript named "2to3". Everyone with python3 installed should have it.

[ondrejj@work ~]$ rpm -qf /usr/bin/2to3
python3-devel-3.7.4-1.fc30.x86_64

MC developers should also contact gryf to include latest patches for uc1541 in upstream. Not sure, why this is maintained separately.

May be it will be better to currently only test my s3+ patch in Fedora and leave mc developers to include them just after some testing. MC without python3 patches is useless for Fedora 32 due to end of life of python2, so it doesn't matter, if this patch works. If don't, then this extension support should be removed.

Comment 20 Tomasz Kłoczko 2019-09-20 15:11:48 UTC
Will try to have look on those patches in next few hours.
Proabably will try to push modified mc to rawhide just after this.

Thx

Comment 21 Tomasz Kłoczko 2019-09-28 15:24:12 UTC
4.8.23-3 which is ported to python3 has been pushed to builder.
Closing.


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