PATCH: python3 smb module

Noel Power nopower at
Wed Feb 14 10:29:06 UTC 2018

On 13/02/18 21:44, Andrew Bartlett wrote:
> On Tue, 2018-02-13 at 12:43 +0000, Noel Power via samba-technical
> wrote:
>> I noticed I erroneously specified the smb_methods in the module def,
>> this doesn't reflect how the previous python 2 code was using the
>> Py_InitModule3 code. I've changed the patch accordingly
>> On a sidenote I wonder should we change the api here for the smb module.
>> I have noticed that loadfile (which although documented to load
>> filecontents as a string) doesn't seem to handle content starting with
>> unicode BOM :/ perhaps returning a byte string might be a better choice
>> (for the python3 variant)
>> I'm working on a test to demonstrate this but python2/python3 is fighting me
> Aside from that (which I'll try and understand later) please ensure the
> patch passes 'make test TESTS=source'.  
hmm, didn't know about that, please see updated patch (for smb module &
test) that satisfies 'make test TESTS=source'
Regarding the problem with loadfile dealing with a BOM in the file
content please see additional patch that demostrates the problem.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-test-source-fix.patch
Type: text/x-patch
Size: 7271 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: show-loadfile-error-with-bom.patch
Type: text/x-patch
Size: 2789 bytes
Desc: not available
URL: <>

More information about the samba-technical mailing list