jailkit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Jailkit-dev] Jailkit-2.20 patch to support Python3


From: William Stearns
Subject: Re: [Jailkit-dev] Jailkit-2.20 patch to support Python3
Date: Tue, 4 Jun 2019 16:50:26 -0400

Good evening, Olivier,
    I'm doing that testing now and have found even more that needs attention:
- openvpn section had to "includesections" lines.
- My configparser fix was incomplete.  So was my attempt at getting a portal octal constant.
- File reads were coming in as bytes and need to be converted to strings on python3
- The string.find/string.split/string.strip/string.join calls are deprecated and are replaced with {orig_string}.split() - type calls.
- raw_input() is replaced with input()

    I've run each of the tools to make sure they'll at least successfully load and have built a chroot tree with jk_init , all with /usr/bin/python pointing at python3.5.  I've not tested any of this under python2.  Would someone with python2 be willing to do basic checks with this patch?
    Cheers,
    - Bill


On Tue, Jun 4, 2019 at 10:46 AM Olivier Sessink <address@hidden> wrote:
thanks!

you're a busy man :)

I've currently little time for actual testing, so I can look at the code and commit. Have you tested the various different python scripts for their functionality?

Olivier


On 04-06-19 00:10, William Stearns wrote:
Good afternoon, all,
    The attached patch replaced the previous 2 and fixes an error I made trying to force py_compile to write out to {modulename}.pyc for compatibility.
    Cheers,
    - Bill


On Mon, Jun 3, 2019 at 5:50 PM William Stearns <address@hidden> wrote:
Good day, all,
    I did screw up on the except calls, sorry for that.  I've attached a new version that:
- replaces
except one_or_more_error_types, (errno, strerror):
    with
except one_or_more_error_types as e:
errno, strerror = e.args

- Makes all prints as functions (and loads "from __future__ import print_function" for compatibility when running under python2)
- Uses the appropriate values for octal 755 in python 2 and 3
- Loads the configparser library as ConfigParser under python 2 and configparser under python 3.
    I've tried to make these the simplest and clearest replacements so the diff is easy to check.  Please let me know if you find any issues with it.
    Cheers,
    - Bill


On Fri, May 31, 2019 at 5:32 PM William Stearns <address@hidden> wrote:
Good day, all,
     I've made the minimal changes needed to run jailkit 2.20 on Python3 - patch is attached.  I've tried to structure this in a form that will continue to work on python2 as well.
    I'd appreciate it if someone could review the "except .... :" lines.  I've connected all of the errors into a single list, like:

-                       except OSError, (errno,strerror):

+                       except (OSError, errno, strerror):


    but am not sure this matches the original intent.
    Many thanks for your work on jailkit.  Cheers,
    - Bill






_______________________________________________
Jailkit-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/jailkit-dev


-- 
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
_______________________________________________
Jailkit-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/jailkit-dev

Attachment: jailkit-2.20-python3-compatibility.201906042043.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]