Hello.

After a recent update on Windows 10, I not able to tell exactly which, I've a strange behavior on a program that works fine since 2015 on thousands of machines...



* With this code :

def networks_private():
    NETWORK_CATEGORIES = {1: "PRIVATE",0: "PUBLIC", 2: "DOMAIN"}
    m = win32com.client.Dispatch("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")
    more = 1
    pos = 1
    connections = m.GetNetworkConnections()
    while more:
        connection, more = connections.Next(pos)
        if connection:
            network = connection.GetNetwork()
            category = network.GetCategory()
            try:
                log('switching network interface in private mode')
                network.SetCategory(1)
            except:
                log("error switching network interface in private mode")
        pos += 1



* I get this error :

Traceback (most recent call last):
[...]
File "Frame1.pyo", line 163, in _init_
File "fonctions.pyo", line 201, in networks_private
File "win32com\client\dynamic.pyo", line 522, ingetattr_
AttributeError: Next.GetNetwork



Regards, thanks.

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to