wrong password-encoding in python-modules?
steuwer at univention.de
Fri Jul 22 13:45:09 GMT 2005
Am Freitag, 22. Juli 2005 15:18 schrieb Simo Sorce:
> On Fri, 2005-07-22 at 14:08 +0200, Ingo Steuwer wrote:
> > Hi
> > I've tried to use the spoolss Python-module to connect to a
> > NT4-Printershare. The password contains german umlauts, which made it
> > impossible to connect.
> > To avoid Codepage-problems, I changed the password to one Character (ä)
> > and iterated from i=0 to 255 doing a python "chr(i)" as password, but
> > none matched.
> > As the routines expect a string (and not a unicode) I expected that one
> > should match. Is this my misunderstanding, or a bug in spoolss-bug/the
> > underlying lib?
> have you tried the corresponding utf-8 char?
> I suspect you confuse "unicode" with the specific windows wire format
Thanks, that's it. Having the password as unicode "pwd" I can use
"pwd.encode('utf8')" in spoolss.openprinter().
Wouldn't it make sense to accept unicode in spoolss, like usual in python?
Ingo Steuwer steuwer at univention.de fon: +49 421 22 232- 0
Entwicklung Linux for Your Business
Univention GmbH http://www.univention.de/ fax: +49 421 22 232-99
More information about the samba-technical