What I Learned Today      [ New Post ]

Tuesday, February 08, 2005

Oversensitive python...

Python is case sensitive when it comes to importing modules. I found this out after running circles around my xbox for an hour.

I was trying to the get the web radio scripts (KMLbrowse.py and SimpleKML.py) to work with Xbox Media Center aka XBMC, and for the life I couldn't figure it out. I tried just about everything I found on the web - modified the scripts to point to an updated URL, reinstalled the python libs, updated my XBMC installation, got new skins for XBMC, got update scripts etc. Nothing worked.

Finally, I turned on XBMC debug logging (set loglevel to 0 in xboxmediacenter.xml) and noticed that it was failing to load the Image module. There was a file called image.py in the lib directory. When I renamed it to Image.py, that error message disappeared and was replaced with another error about another library.

I did a quick check on the files on my xbox vs the files in the installation RAR archive. Sure enough, the filenames were different case. Apparently, my FTP client was set to downcase filenames when uploading files, which resulted in all the python modules being downcased!

I fixed the FTP client setup, re-FTP'ed the python modules, and guess what? Everything worked...

1 Comments:

  • totally love you man, this solved all my problems too!

    By Anonymous Anonymous, at 3:56 PM  

Post a Comment

<< Home