From: Sean DiZazzo on 14 Apr 2010 18:18 Hi! I have a small app that uses pywin32 to log on to a remote host and send some files around. It works well, but I've found a machine that the app won't work on. The machine is dual-homed, with one interface able to see the server machine, but the other can not. I don't have the exact error because I can't currently get on to the machine where the app fails, but I am told it is something like that "that server doesn't exist". Could it be that it is trying to use the wrong interface? ie. The interface on the wrong vlan? If so, is there a way to force the connection to go to a specific interface? I'll post the exact error after I can get on that machine. Thanks! ~Sean I'm using this wnet_connect() function that I found somewhere. It works perfectly except on this one machine. def wnet_connect(self, host, username, password): unc = ''.join(['\\\\', host]) try: win32wnet.WNetAddConnection2(win32.RESOURCETYPE_DISK, None, unc, None, username, password) except Exception, err: if isinstance(err, win32wnet.error): if err[0] == 1219: win32wnet.WNetCancelConnection2(unc, 0, 0) return wnet_connect(host, username, password) raise err
From: Sean DiZazzo on 15 Apr 2010 01:12 On Apr 14, 9:22 pm, Dennis Lee Bieber <wlfr...(a)ix.netcom.com> wrote: > On Wed, 14 Apr 2010 15:18:11 -0700 (PDT), Sean DiZazzo > <half.ital...(a)gmail.com> declaimed the following in > gmane.comp.python.general: > > > > > def wnet_connect(self, host, username, password): > > The presence of "self" in that parameter list implies this is a > method defined inside a class. > > > return wnet_connect(host, username, password) > > This recursive call is missing the instance reference... > > return self.wnet_connect(...) Wow. Good eye! To be honest, I'm not sure how that happened. I guess it should have given me an error if it ever reached that block though, right? I'll take a close look at that tomorrow AM. Thanks! ~Sean
|
Pages: 1 Prev: Relocatable python install Next: Windows installer of Python |