<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/python/samba/compat.py, branch talloc-2.2.0</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>python/samba: fix default params for PY3 ConfigParser</title>
<updated>2018-12-10T09:38:22+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-11-06T19:47:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0cd885c1ec71c4f9cbed96328cd82de27cdc091f'/>
<id>0cd885c1ec71c4f9cbed96328cd82de27cdc091f</id>
<content type='text'>
The default params for the python3 version of the compat ConfigParser
are not correct. Code like
   foo = ConfigParser()
fails because of this.

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The default params for the python3 version of the compat ConfigParser
are not correct. Code like
   foo = ConfigParser()
fails because of this.

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/samba: PY3 compat py2/p3 symbol for SocketServer/socketserver</title>
<updated>2018-12-10T09:38:21+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-11-28T15:33:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=fdf2deb3ba18932d255e19acb08b67cb3f24f6f4'/>
<id>fdf2deb3ba18932d255e19acb08b67cb3f24f6f4</id>
<content type='text'>
SocketServer was renamed to socketserver in Py3, this patch
create a samba.compat.SocketServer which can be used in py2 or
py3

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SocketServer was renamed to socketserver in Py3, this patch
create a samba.compat.SocketServer which can be used in py2 or
py3

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/samba: add alias for ConfigParser for PY2/PY3 compatability</title>
<updated>2018-10-23T03:50:26+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-08-24T08:55:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=600fde58ab616f7c786b43da23acb0b441bd6885'/>
<id>600fde58ab616f7c786b43da23acb0b441bd6885</id>
<content type='text'>
ConfigParser module changed name to configParser in PY3, additionally
the behaviour regarding interpolation has changed. ConfigParser now
has a default interpolation param whose behaviour demands that '%' is
escaped. To maintain behaviour with the python2 version this default
param needs to be changed. Add some alias(s) and 'shim' Configparser
symbol in samba.compat to cater for this.

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ConfigParser module changed name to configParser in PY3, additionally
the behaviour regarding interpolation has changed. ConfigParser now
has a default interpolation param whose behaviour demands that '%' is
escaped. To maintain behaviour with the python2 version this default
param needs to be changed. Add some alias(s) and 'shim' Configparser
symbol in samba.compat to cater for this.

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/samba: PY3 add compat function urllib_join to replace urllib.urljoin</title>
<updated>2018-09-26T23:54:27+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-09-19T08:52:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=f71675dcbee6cef5b1c6972d1281feb37e8e70b0'/>
<id>f71675dcbee6cef5b1c6972d1281feb37e8e70b0</id>
<content type='text'>
Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PEP8: fix E111: indentation is not a multiple of four</title>
<updated>2018-09-06T10:10:11+00:00</updated>
<author>
<name>Joe Guo</name>
<email>joeg@catalyst.net.nz</email>
</author>
<published>2018-09-03T13:05:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0f67b6e4b90d54fb75e078972baf392fca643056'/>
<id>0f67b6e4b90d54fb75e078972baf392fca643056</id>
<content type='text'>
Signed-off-by: Joe Guo &lt;joeg@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joe Guo &lt;joeg@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/samba: Add some helper functions to encode/decode strings</title>
<updated>2018-09-03T01:22:22+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-08-11T12:54:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=210b950c81d252c0af0fb82cb9241fad0ead5280'/>
<id>210b950c81d252c0af0fb82cb9241fad0ead5280</id>
<content type='text'>
Sometimes in PY3 we have variables whose content can be 'bytes' or
'str' and we can't be sure which. Generally this is because the
code variable to be used can be initialised (or reassigned) a value
from different api(s) or functions depending on complex conditions or
logic. Or another common case is in PY2 the variable is 'type &lt;str&gt;'
and in PY3 it is 'class &lt;str&gt;' but the function to use e.g. b64encode
requires 'bytes' in PY3. In such cases in PY3 it would be nice to avoid
excessive testing in the client code, in PY2 we would like to ensure the
code runs unchanged. In otherwords we wish to avoid in PY2 unnecessary
decode() calls which convert otherwise 'str' types to 'unicode'.
Mixing 'str' and 'unicode' can cause strange and unexpected problems,
sometimes we can't avoid this but it we should avoid if we can.

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometimes in PY3 we have variables whose content can be 'bytes' or
'str' and we can't be sure which. Generally this is because the
code variable to be used can be initialised (or reassigned) a value
from different api(s) or functions depending on complex conditions or
logic. Or another common case is in PY2 the variable is 'type &lt;str&gt;'
and in PY3 it is 'class &lt;str&gt;' but the function to use e.g. b64encode
requires 'bytes' in PY3. In such cases in PY3 it would be nice to avoid
excessive testing in the client code, in PY2 we would like to ensure the
code runs unchanged. In otherwords we wish to avoid in PY2 unnecessary
decode() calls which convert otherwise 'str' types to 'unicode'.
Mixing 'str' and 'unicode' can cause strange and unexpected problems,
sometimes we can't avoid this but it we should avoid if we can.

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/compat: use cStringIO instead of StringIO in compat.py</title>
<updated>2018-09-03T01:22:21+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-08-10T18:54:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=94c23ee046ca9cfa36ab5aedfeb56faf8eee459c'/>
<id>94c23ee046ca9cfa36ab5aedfeb56faf8eee459c</id>
<content type='text'>
Using cStringIO for py2 seems to incur alot less problems and less changes
to the py2/py3 code then using StringIO.StringIO

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using cStringIO for py2 seems to incur alot less problems and less changes
to the py2/py3 code then using StringIO.StringIO

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PEP8: fix E271: multiple spaces after keyword</title>
<updated>2018-08-24T05:49:25+00:00</updated>
<author>
<name>Joe Guo</name>
<email>joeg@catalyst.net.nz</email>
</author>
<published>2018-07-30T03:42:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=831bb3575d7e2151d670a1cc2ecae8e6e06a573d'/>
<id>831bb3575d7e2151d670a1cc2ecae8e6e06a573d</id>
<content type='text'>
Signed-off-by: Joe Guo &lt;joeg@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joe Guo &lt;joeg@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/samba: Add cmp_fn and cmp_to_key_fn functions for py2/py3</title>
<updated>2018-07-12T23:12:25+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-06-15T12:00:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0e930dfb477b121b69351cc9a011dfb71bcd10c0'/>
<id>0e930dfb477b121b69351cc9a011dfb71bcd10c0</id>
<content type='text'>
the cmp function and the cmp paramater (e.g. to sort functions)
no longer exist in python3.

cmp_fn is provides the missing functionality of the py2 cmp builtin
function.

cmp_to_key_fn allows the key paramater (e.g. for sort) to use the
old py2 cmp function for sorting. Note: the cmp_to_key is present in
since 2.7 (hence the inclusion of the source code for this function pre
that version)

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Signed-off-by: Joe Guo &lt;joeg@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the cmp function and the cmp paramater (e.g. to sort functions)
no longer exist in python3.

cmp_fn is provides the missing functionality of the py2 cmp builtin
function.

cmp_to_key_fn allows the key paramater (e.g. for sort) to use the
old py2 cmp function for sorting. Note: the cmp_to_key is present in
since 2.7 (hence the inclusion of the source code for this function pre
that version)

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Signed-off-by: Joe Guo &lt;joeg@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/samba: Add binary_type for p2/p3 testing.</title>
<updated>2018-04-30T13:43:19+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-04-24T15:28:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=cbd6786c0471782024750b85b6f4fbf42977c81b'/>
<id>cbd6786c0471782024750b85b6f4fbf42977c81b</id>
<content type='text'>
For helping test for binary types, binary_type evaluates to 'str'
in py2, and 'bytes' in py3.

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Alexander Bokovoy &lt;ab@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For helping test for binary types, binary_type evaluates to 'str'
in py2, and 'bytes' in py3.

Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Alexander Bokovoy &lt;ab@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
