[python-win32] Issues with tkinter, COM servers and Python 3.x

Tim Roberts timr at probo.com
Tue May 19 01:02:27 CEST 2015


Diego Vélez Torres wrote:
>
> I finally was able to fix this issue in my code.  Thanks for your
> advise.  Now I want to share with the community exactly what I did by
> posting the whole "__init__" method of tkinter's  "__init__.py" file:
>
> def __init__(self, screenName=None, baseName=None, className='Tk',
>                  useTk=1, sync=0, use=None):
> ...        # Condition added by Diego Velez so 'tkinter' can be called
> from COM Servers. --May 18th, 2015
>             if isinstance(baseName, bytes):
>                 baseName = baseName.decode()

That's very bizarre.  Did you print out the value of baseName to see
what it was?  I'm wondering if something in the Python COM machinery is
faking os.path.basename and didn't get the memo about strings in Python 3.

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



More information about the python-win32 mailing list