win32net.NetUseAdd syntax, possible bug

Scott Prive scottprive at earthlink.net
Wed Apr 16 09:01:46 EDT 2003


Hello,

I'm attempting to use win32net.NetUseAdd, had a problem and I think there's
a bug in the API, or the docs (or me! :-)

The ActiveState made it clear most of the properties need to be in a
dictionary. It lacked an example use, but referred me to the MSDN site, and
at MSDN could see there the data structure. In theory I should combine the
two docs and know all the things I can pass into the call via dictionary.

Small problem: the MSDN data structure calls the PW key "password", and
win32net.NetUseAdd does not understand this. It looks like the function
needs a key called "passwd", and if not provided it falls upon some default
value (or the current credentials), making it appear that your user/pass
values are not valid on the server when in fact they were.

This is my first post to the list (cc: me, I'm not subscribed). Is this the
appropriate place for possible bug reports? How do I determine a module's
"owner", and should I mail them directly?

The code looks like:

    import win32net
    data = {}
    data['remote'] = r'\\mypdc.example.com\myshare'
    data['local'] = 'Z:'
    data['password'] = 'foo' #Hmm.. I should call this     data['passwd'] =
'foo'
    data['user'] = 'foo'
    data['asg_type'] = 0
    win32net.NetUseAdd(None,1,data)

-Scott









More information about the Python-list mailing list