[PATCH] Allow py_smb_savefile() to except utf text

Andrew Bartlett abartlet at samba.org
Fri Jul 28 22:27:42 UTC 2017

On Fri, 2017-07-28 at 09:04 -0600, David Mulder via samba-technical
> Hi,
> This patch allows the smb python bindings to write utf encoded text to a
> file. Without this patch, py_smb_savefile() can only write ascii.
> Writing ascii to a utf-16 encoded file would leave trailing utf-16 chars
> at the end of the file, and trying to pass utf-16 to the savefile
> function would throw an exception.
> Andrew and Garming,
> This is related to the GPO patches. This is needed in order to write to
> files in sysvol (since GptTmpl.inf, for example, is utf-16 encoded).
> I've written a tool for modifying GPO policies. Please review.

Any chance of a test?

This just feels like the kind of thing that we need to be really
careful to have a test for giving future conversions to python3 where
the string behaviour changes.


Andrew Bartlett

Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

More information about the samba-technical mailing list