I tried using my 64 bit Python 3.6 and ran into the same problem.
Tracing through with pdb, the following line seems to be where it hung up:
> c:\program 
> files\python36\lib\site-packages\win32com\server\register.py(419)RegisterClasses()
-> moduleName = os.path.splitext(win32api.FindFiles(sys.argv[0])[0][8])[0]
(Pdb) n

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.

I think I installed pywin32 via pip.

Ross
________________________________________
From: Boylan, Ross
Sent: Tuesday, December 4, 2018 1:48 PM
To: python-win32@python.org
Subject: Re: COM registration hangs up: 32 bit Python 3.7 on 64 bit Win 7

Sorry: previous message went out before complete.

Terminal:
Z:\FahyGroup\Ross Boylan\Wk devel>py BSTImport.py --debug
aatmpt_bst
In main. Attempting to register.
Args = ['BSTImport.py', '--debug']

And then it just sits there.  ^C at the terminal does not interrupt it, though 
I can kill the python process.  Searching in the registry does not indicate any 
of the keys associated with my class.

How do I solve this, or at least debug it?

The main application is in 32 bit Access 2010, although the system is 64 bit 
Win 7.  When I discovered I couldn't open the relevant libraries (esp DAO) from 
64 bit python 3.6 I installed 32 bit python 3.7.  I can use it as a client 
application, but wanted to make it a server.

BSTImport.py includes

import pdb, traceback
import atexit, csv, sys
import pythoncom, win32com.client
from win32com.server.exception import COMException
from win32com.client import constants
from win32com.server.register import UseCommandLine

TmpTable = "aatmpt_bst"  # table to import csv into

print(TmpTable)

class BSTImport:
    # COM Support
    _public_methods_ = ['Fred']

    _reg_clsid_ = "{050321C2-9B99-4444-B5E9-B636DFD94C4D}"
    _reg_desc_ = "BST Test Com Server in Python 32 bit"
    _reg_progid_ = "Fahy.BST"

    def Fred(self, name, obj):
        return "Hey {}; I'm Fred. I mess with {}.".format(name, TmpTable)

   # other stuff only relevant as a client


if __name__ == "__main__":
    print("In main. Attempting to register.\nArgs = {}".format(sys.argv))
    UseCommandLine(BSTImport)
    print("I think I'm done.")
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to