Discussion:
[PR PATCH] Some py2 p3 bulk compat changes
Github bot account via samba-technical
2018-04-27 07:31:50 UTC
Permalink
There is a new pull request by noelpower against master on the Samba Samba Github repository

https://github.com/noelpower/samba some-py2-p3-bulk-compat-changes
https://github.com/samba-team/samba/pull/171

Some py2 p3 bulk compat changes
This patchset rolls up
* some patches from the WIP branch mentioned in #161
* #166
* #170
and some additional small changes.


A patch file from https://github.com/samba-team/samba/pull/171.patch is attached
Alexander Bokovoy via samba-technical
2018-04-27 07:48:56 UTC
Permalink
Post by Github bot account via samba-technical
There is a new pull request by noelpower against master on the Samba Samba Github repository
https://github.com/noelpower/samba some-py2-p3-bulk-compat-changes
https://github.com/samba-team/samba/pull/171
Some py2 p3 bulk compat changes
This patchset rolls up
* some patches from the WIP branch mentioned in #161
* #166
* #170
and some additional small changes.
A patch file from https://github.com/samba-team/samba/pull/171.patch is attached
Not commenting on the patchset itself but the github gate seems to be
broken as it attached an html page instead of a patch.
--
/ Alexander Bokovoy
Noel Power via samba-technical
2018-04-27 08:43:06 UTC
Permalink
Hi Alexander
Post by Alexander Bokovoy via samba-technical
Post by Github bot account via samba-technical
There is a new pull request by noelpower against master on the Samba Samba Github repository
https://github.com/noelpower/samba some-py2-p3-bulk-compat-changes
https://github.com/samba-team/samba/pull/171
Some py2 p3 bulk compat changes
This patchset rolls up
* some patches from the WIP branch mentioned in #161
* #166
* #170
and some additional small changes.
A patch file from https://github.com/samba-team/samba/pull/171.patch is attached
Not commenting on the patchset itself but the github gate seems to be
broken as it attached an html page instead of a patch.
Thanks for spotting that, haven't a clue why that is happening
(hopefully someone does and/or can fix)
Attached is the patch set anyway

Noel
Alexander Bokovoy via samba-technical
2018-04-27 09:12:56 UTC
Permalink
Post by Noel Power via samba-technical
Hi Alexander
Post by Alexander Bokovoy via samba-technical
Post by Github bot account via samba-technical
There is a new pull request by noelpower against master on the Samba Samba Github repository
https://github.com/noelpower/samba some-py2-p3-bulk-compat-changes
https://github.com/samba-team/samba/pull/171
Some py2 p3 bulk compat changes
This patchset rolls up
* some patches from the WIP branch mentioned in #161
* #166
* #170
and some additional small changes.
A patch file from https://github.com/samba-team/samba/pull/171.patch is attached
Not commenting on the patchset itself but the github gate seems to be
broken as it attached an html page instead of a patch.
Thanks for spotting that, haven't a clue why that is happening
(hopefully someone does and/or can fix)
Attached is the patch set anyway
Noel
@@ -3110,7 +3110,7 @@ static PyObject *py_ldb_msg_element_new(PyTypeObject *type, PyObject *args, PyOb
char *_msg = NULL;
result = PyBytes_AsStringAndSize(item, &_msg, &size);
msg = _msg;
- } else if (PyStr_Check(item)) {
+ } else if (PyUnicode_Check(item)) {
Why not both PyStr_Check()/PyUnicode_Check()?
Post by Noel Power via samba-technical
From 08fe5590f190cf444056d322b1b1e45119bd93c2 Mon Sep 17 00:00:00 2001
Date: Fri, 13 Apr 2018 17:17:20 +0100
Subject: [PATCH 02/14] lib/tevent: Additionally accept unicode as string param
in Py2
ACK for this one.
Post by Noel Power via samba-technical
From 0cf4bdf13493b3d07c976c0cf9a31fafeb497e60 Mon Sep 17 00:00:00 2001
Date: Fri, 13 Apr 2018 17:32:15 +0100
Subject: [PATCH 03/14] libcli/nbt: Additionally accept unicode as string param
in Py2
ACK for this one.
Post by Noel Power via samba-technical
From 4517cd7b8de013ffaea37d7eb73dfb332e8c6b72 Mon Sep 17 00:00:00 2001
Date: Fri, 13 Apr 2018 17:33:10 +0100
Subject: [PATCH 04/14] s4/auth: Additionally accept unicode as string param in
Py2
ACK for this one.
Post by Noel Power via samba-technical
From c4fbae86ef880e6eff5015a3e846686a530685cc Mon Sep 17 00:00:00 2001
Date: Fri, 13 Apr 2018 17:33:47 +0100
Subject: [PATCH 05/14] s4/dsdb: Additionally accept unicode as string param in
Py2
ACK for this one.
Post by Noel Power via samba-technical
From defe82e5b81996ec2c99a4faf0904580d95a9851 Mon Sep 17 00:00:00 2001
Date: Fri, 13 Apr 2018 17:34:19 +0100
Subject: [PATCH 06/14] s4/librpc: Additionally accept unicode as string param
in Py2
ACK for this one.
Post by Noel Power via samba-technical
From 813331aefeee5c1e4d214551939f3d5a40d8811d Mon Sep 17 00:00:00 2001
Date: Fri, 13 Apr 2018 17:34:40 +0100
Subject: [PATCH 07/14] s4/param: Additionally accept unicode as string param
in Py2
ACK for this one.
Post by Noel Power via samba-technical
From 793b4084ec3da24b44cb962f17ded6ef0c595b6e Mon Sep 17 00:00:00 2001
Date: Fri, 13 Apr 2018 11:19:10 +0100
Subject: [PATCH 08/14] python/samba: Add some compatability PY2/PY3 functions
ACK for this one.
Post by Noel Power via samba-technical
From 8d054c52ec11e37a4841fbec4357664b4aeb2b44 Mon Sep 17 00:00:00 2001
Date: Tue, 17 Apr 2018 13:52:58 +0100
Subject: [PATCH 09/14] Add aliases for StringIO.StringIO
ACK for this one.
Post by Noel Power via samba-technical
From 2dd5aedaafd9859cb07679397010b2ce89633308 Mon Sep 17 00:00:00 2001
Date: Tue, 24 Apr 2018 16:28:41 +0100
Subject: [PATCH 10/14] python/samba: Add binary_type for p2/p3 testing.
ACK for this one.
Post by Noel Power via samba-technical
From dbdd153607c5421f5a2fcadaa43c47b51b748184 Mon Sep 17 00:00:00 2001
Date: Wed, 25 Apr 2018 18:28:30 +0100
Subject: [PATCH 11/14] python/samba: bulk conversion of caller to dsdb_Dn 2nd
param.
ACK for this one.
Post by Noel Power via samba-technical
From 4989e188968c9523cd01de62553fd8bb6eddfd0c Mon Sep 17 00:00:00 2001
Date: Wed, 25 Apr 2018 20:01:49 +0100
Subject: [PATCH 12/14] python: Bulk conversion callers of ldb.Dn second param
ACK for this one.
Post by Noel Power via samba-technical
From e351470d31a2163bcd18f0d3a59c2082174f6c62 Mon Sep 17 00:00:00 2001
Date: Thu, 26 Apr 2018 10:38:57 +0100
Subject: [PATCH 13/14] python/samba: port some isinstance str checks (to cater
for unicode)
ACK for this one.
Post by Noel Power via samba-technical
From c5ab297174c2c2bc4897ec4f21aa3cfe5f0e84a9 Mon Sep 17 00:00:00 2001
Date: Fri, 27 Apr 2018 08:15:28 +0100
Subject: [PATCH 14/14] python/samba: Py2/Py3 compat change '/' to '//' to
ensure int result
---
python/samba/graph.py | 4 ++--
python/samba/netcmd/domain.py | 2 +-
python/samba/upgradehelpers.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/python/samba/graph.py b/python/samba/graph.py
index 6cdd2ef77ed..25711028dda 100644
--- a/python/samba/graph.py
+++ b/python/samba/graph.py
q, p = p.split('-', 1)
- n = len(p) / 12
- b = len(p) / n
+ n = len(p) // 12
+ b = len(p) // n
I wonder if we should also do

from __future__ import division

to enforce PEP238 in py2 too.

$ python
Python 2.7.14 (default, Mar 14 2018, 13:36:31)
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Post by Noel Power via samba-technical
Post by Alexander Bokovoy via samba-technical
Post by Github bot account via samba-technical
10/2
5
Post by Noel Power via samba-technical
Post by Alexander Bokovoy via samba-technical
Post by Github bot account via samba-technical
10//2
5
Post by Noel Power via samba-technical
Post by Alexander Bokovoy via samba-technical
Post by Github bot account via samba-technical
from __future__ import division
10/2
5.0
Post by Noel Power via samba-technical
Post by Alexander Bokovoy via samba-technical
Post by Github bot account via samba-technical
10//2
5
--
/ Alexander Bokovoy
Noel Power via samba-technical
2018-04-27 09:45:55 UTC
Permalink
Hi Alexander
On 27/04/18 10:12, Alexander Bokovoy wrote:
[...]
Post by Alexander Bokovoy via samba-technical
Post by Noel Power via samba-technical
@@ -3110,7 +3110,7 @@ static PyObject *py_ldb_msg_element_new(PyTypeObject *type, PyObject *args, PyOb
char *_msg = NULL;
result = PyBytes_AsStringAndSize(item, &_msg, &size);
msg = _msg;
- } else if (PyStr_Check(item)) {
+ } else if (PyUnicode_Check(item)) {
Why not both PyStr_Check()/PyUnicode_Check()?
It's already covered in the previous else if (not shown in the context)
e.g the diff (with more context) would show
-                        if (PyBytes_Check(obj)) {
-                                    /* do stuff */
-                        } else if (PyStr_Check(obj)) {
-                                    /* do stuff */1
-                        } else {

+                        if (PyBytes_Check(obj)) {
+                                   /* do stuff */
+                        } else if (PyUnicode_Check(obj)) {
+                                    /* do stuff */1
+                        } else {
[...]
Post by Alexander Bokovoy via samba-technical
Post by Noel Power via samba-technical
index 6cdd2ef77ed..25711028dda 100644
--- a/python/samba/graph.py
+++ b/python/samba/graph.py
q, p = p.split('-', 1)
- n = len(p) / 12
- b = len(p) / n
+ n = len(p) // 12
+ b = len(p) // n
I wonder if we should also do
from __future__ import division
to enforce PEP238 in py2 too.
sure, I'll try it and resubmit the branch, thanks alot for the review!

Noel
Alexander Bokovoy via samba-technical
2018-04-27 14:22:31 UTC
Permalink
Post by Noel Power via samba-technical
Hi Alexander
[...]
Post by Alexander Bokovoy via samba-technical
Post by Noel Power via samba-technical
@@ -3110,7 +3110,7 @@ static PyObject *py_ldb_msg_element_new(PyTypeObject *type, PyObject *args, PyOb
char *_msg = NULL;
result = PyBytes_AsStringAndSize(item, &_msg, &size);
msg = _msg;
- } else if (PyStr_Check(item)) {
+ } else if (PyUnicode_Check(item)) {
Why not both PyStr_Check()/PyUnicode_Check()?
It's already covered in the previous else if (not shown in the context)
e.g the diff (with more context) would show
-                        if (PyBytes_Check(obj)) {
-                                    /* do stuff */
-                        } else if (PyStr_Check(obj)) {
-                                    /* do stuff */1
-                        } else {
+                        if (PyBytes_Check(obj)) {
+                                   /* do stuff */
+                        } else if (PyUnicode_Check(obj)) {
+                                    /* do stuff */1
+                        } else {
[...]
Post by Alexander Bokovoy via samba-technical
Post by Noel Power via samba-technical
index 6cdd2ef77ed..25711028dda 100644
--- a/python/samba/graph.py
+++ b/python/samba/graph.py
q, p = p.split('-', 1)
- n = len(p) / 12
- b = len(p) / n
+ n = len(p) // 12
+ b = len(p) // n
I wonder if we should also do
from __future__ import division
to enforce PEP238 in py2 too.
sure, I'll try it and resubmit the branch, thanks alot for the review!
Thanks. I see that the travis-ci run went fine and my comments were
addressed. RB+. Please push.
--
/ Alexander Bokovoy
Github bot account via samba-technical
2018-04-27 09:53:18 UTC
Permalink
There is an updated pull request by noelpower against master on the Samba Samba Github repository

https://github.com/noelpower/samba some-py2-p3-bulk-compat-changes
https://github.com/samba-team/samba/pull/171

Some py2 p3 bulk compat changes
This patchset rolls up
* some patches from the WIP branch mentioned in #161
* #166
* #170
and some additional small changes.


A patch file from https://github.com/samba-team/samba/pull/171.patch is attached
Github bot account via samba-technical
2018-04-30 17:37:28 UTC
Permalink
There's a closed pull request on the Samba Samba Github repository

Some py2 p3 bulk compat changes
https://github.com/samba-team/samba/pull/171
Description: This patchset rolls up
* some patches from the WIP branch mentioned in #161
* #166
* #170
and some additional small chang
Github bot account via samba-technical
2018-04-30 17:37:28 UTC
Permalink
New comment by noelpower on Samba Github repository

https://github.com/samba-team/samba/pull/171#issuecomment-385472400
Comment:
was integrated at 268ad19eee469ef7d703d5b

Loading...