Skip to content

iTunes 7.7 COM bug

I’ve had a little utility for quite some time now that I use mainly to let the iTunes’ current song play through its end, then stop. It’s one feature from Winamp that I couldn’t deal without.

Quite recently, I upgraded to iTunes 7.7. My little utility stopped working. When I finally got around to looking into the error, I found this:

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32com.client
>>> itunes = win32com.client.Dispatch("iTunes.Application")
>>> help(itunes._print_details_)
Help on method _print_details_ in module win32com.client.dynamic:

_print_details_(self) method of win32com.client.CDispatch instance
Debug routine - dumps what it knows about an object.

>>> itunes._print_details_()
AxDispatch container iTunes.Application
Methods:
Props:
Get Props:
Put Props:
>>>

You’ll note that as far as COM is concerned, iTunes no longer publishes any methods or properties in its only externally instantiable interface. In other words, it’s become a black box with no inputs or outputs. You can tell that it’s there, but you can’t interact with it in any way.

I may try again in some other language; it’s possible that iTunes is somehow no longer compatible with the python win32com implementation, but still works with others. Still, it’s annoying.

[edit 20080914]

Things work nicely again in iTunes 8.0.0.35; hopefully they stay working this time.

Also, I discovered that my code example above is not very helpful. It seems that the methods in the win32com client object are lazily added the first time they are called, so _print_details_() will only ever show methods that have already been called successfully. I suppose I should be happy that they implemented COM support at all, instead of being annoyed that introspection doesn’t work as well as python has accustomed me to.

RSS feed

Comments

No comments yet.

Sorry, the comment form is closed at this time.