Hello, I am trying to write a login script for a windows network that gets the groups that a member is part of from active directory in order to determine what drives to map. I am attempting to use Tim Golden's active_directory module to do this however when I try to run even any sample code from his website this error is returned.

Traceback (most recent call last):
  File "C:\Documents and Settings\mike.harter\My Documents\Python\Login\loginScript.py", line 52, in <module>
    for person in active_directory.search ("objectCategory='Person'"):
  File "C:\Documents and Settings\mike.harter\My Documents\Python\Login\active_directory.py", line 572, in search
    for result in query ("\n".join (sql_string), Page_size=50):
  File "C:\Documents and Settings\mike.harter\My Documents\Python\Login\active_directory.py", line 295, in query
    command.ActiveConnection = connection ()
  File "C:\Documents and Settings\mike.harter\My Documents\Python\Login\active_directory.py", line 260, in connection
    _connection.Open ("Active Directory Provider")
  File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 467, in __getattr__
    if self._olerepr_.mapFuncs.has_key(attr): return self._make_method_(attr)
  File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 295, in _make_method_
    methodCodeList = self._olerepr_.MakeFuncMethod(self._olerepr_.mapFuncs[name], methodName,0)
  File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 297, in MakeFuncMethod
    return self.MakeDispatchFuncMethod(entry, name, bMakeClass)
  File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 318, in MakeDispatchFuncMethod
    s = linePrefix + 'def ' + name + '(self' + BuildCallList(fdesc, names, defNamedOptArg, defNamedNotOptArg, defUnnamedArg, defOutArg) + '):'
  File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 604, in BuildCallList
    argName = MakePublicAttributeName(argName)
  File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 542, in MakePublicAttributeName
    return filter( lambda char: char in valid_identifier_chars, className)
  File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 542, in <lambda>
    return filter( lambda char: char in valid_identifier_chars, className)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 52: ordinal not in range(128)

I am just starting to code in python so if someone could help me out I would greatly appreciate it. Is there a fix for this or something or is there an alternative method I can use?

I would try to contact Tim Golden. At first glance, it looks like his AD module doesn't handle Unicode properly (though I might be mistaken about this)

Jeff

Hello,

I am struggeling with this error too.

I use it to open excel templates to dump/report multiple textfiles. It worked on Win2000, but it does not work on XP and Vista....

Hoping for a solution...

ldk

This article has been dead for over six months. Start a new discussion instead.