[python-win32] win32api.FindFiles hangs (was COM registration hangs up: 32 bit Python 3.7 on 64 bit Win 7)

Boylan, Ross Ross.Boylan at ucsf.edu
Wed Dec 19 17:49:36 EST 2018


The same problem occurs from another Win 7 machine so it is not-machine specific, though it might be Win 7 specific.  The C++ test program works fine from Win Server 2012 R2, run against the same share.

________________________________________
From: Boylan, Ross
Sent: Tuesday, December 18, 2018 11:50:13 AM
To: Tim Roberts; python-win32 at python.org
Subject: Re: [python-win32] win32api.FindFiles hangs (was COM registration hangs up: 32 bit Python 3.7 on 64 bit Win 7)

BTW, I installed Visual Studio and wrote a little C++ program that exercised FindNextFile.  It failed in exactly the same way (returns same filename forever if on a network drive and search spec has the exact file name), but only when run from the original machine.

This is only one of many signs that the machine (not PyWin) is messed up; we're getting a replacement.

Thanks for your help.
Ross

P.S.  Does anyone know why the python com code is doing a Dir() when it already has the exact file name?

________________________________________
From: Boylan, Ross
Sent: Wednesday, December 5, 2018 5:40:56 PM
To: Tim Roberts; python-win32 at python.org
Subject: Re: [python-win32] win32api.FindFiles hangs (was COM registration hangs up: 32 bit Python 3.7 on 64 bit Win 7)

Yes, the directory is a net share.  On a local hard drive I do not experience this problem.

If I ask for *.py I get a list back that includes the file.  If I ask for "BSTI*" I get back a list of 1 element, the file.  But if I ask for "BSTImport.py" it hangs.

My experiments with Dir$() in Visual Basic , reported earlier, strongly suggest the problem is that Windows FindNextFile function simply keeps returning the file name forever.

I've reported this to the people running the server, though it certainly could be a problem on my local machine.

I code in C, but don't have a development environment handy. Hence the test in VBA.

Ross

________________________________________
From: python-win32 <python-win32-bounces+ross.boylan=ucsf.edu at python.org> on behalf of Tim Roberts <timr at probo.com>
Sent: Wednesday, December 5, 2018 2:21:33 PM
To: python-win32 at python.org
Subject: Re: [python-win32] win32api.FindFiles hangs (was COM registration hangs up: 32 bit Python 3.7 on 64 bit Win 7)

Boylan, Ross wrote:
>
> Is this some kind of string conversion issue?  My installation is borked?
> Manual debugging statements show sys.argv[0] is 'BSTImport.py'.
>
> win32api.FindFiles('BSTImport.py')
> in a python 3.7 shell (32 bit) hangs.

That's quite bizarre.  The code for win32api.FindFiles is
straightforward.  Is this a special directory, like a net share or
something?  If you ask for *.py, is BSTImport.py in the list you get back?

Do you code in C?  You might code up a trivial C app to run a
FindFirstFile/FindNextFile loop with the same parameters to see if the
same thing happens.  Of course, I'm not sure what the next step would
be, whether that worked or failed.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

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


More information about the python-win32 mailing list