win32net.NetUseAdd syntax, possible bug

Scott Prive scottprive at
Wed Apr 16 15:01:46 CEST 2003


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'\\\myshare'
    data['local'] = 'Z:'
    data['password'] = 'foo' #Hmm.. I should call this     data['passwd'] =
    data['user'] = 'foo'
    data['asg_type'] = 0


More information about the Python-list mailing list