[python-win32] win32net.NetUseAdd buglet (or doc buglet)

Scott Prive scottprive at earthlink.net
Wed Apr 16 19:54:28 EDT 2003


Under Python 2.2.2 (ActiveState) I'm attempting to use win32net.NetUseAdd...
I think there's
a bug in the API wrapper.

The module/method docs I found on ActiveState for win32net.NetUseAdd, state
that share info is passed to the function in the form of a dictionary.
There's no example usage [sorry to complain, wish there were...] but it does
point me to MSDN for more info.

The problem?

The MSDN documentation has example usage (share path, user, password etc.).
But in their example they call password, "password".... the Pythin win32
wrapper doesn't understand ['password'] (and does not raise an exception on
its use), but it DOES understand ['passwd'].

So either MSDN is wrong or the wrapper's got a buglet. :-)

I'm new but learning, so my follow-up to this is, "Is there a way I could
have verified the argument requirements of a function"? In this case, I
could not find a .py file... I could only find win32net.pyd binary file (and
perhaps there would have been a command to query a function's needs, in the


The code looks like:

    import win32net
    data = {}
    data['remote'] = r'\\mypdc.example.com\myshare'
    data['local'] = 'Z:'
    data['password'] = 'foo' # This will FAIL with "bad password or
    # data['passwd'] = 'foo'
    data['user'] = 'foo'
    data['asg_type'] = 0


More information about the Python-win32 mailing list