Tuesday, January 26, 2010

App Engine: AttributeError: 'module' object has no attribute 'Message'

Today I wasted over an hour trying to receive mail in App Engine. Every time I'd try to use it, I'd get errors like:

'module' object has no attribute 'Message'
Traceback (most recent call last):
File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 509, in __call__
handler.post(*groups)
File "/base/python_lib/versions/1/google/appengine/ext/webapp/mail_handlers.py", line 58, in post
self.receive(mail.InboundEmailMessage(self.request.body))
File "/base/python_lib/versions/1/google/appengine/api/mail.py", line 546, in __init__
mime_message = _parse_mime_message(mime_message)
File "/base/python_lib/versions/1/google/appengine/api/mail.py", line 227, in _parse_mime_message
if isinstance(mime_message, email.Message.Message):
AttributeError: 'module' object has no attribute 'Message'

Turns out I'd named my file "email.py", which is a builtin module for python. Rename it and it works fine.

Don't forget to delete the email.pyc, or your dev_appserver will complain about "ImportError: No module named email.message".

Monday, January 25, 2010

Firefox crashes when using facebook chat

Using firefox 3 for Linux, I was surprised to see it keep crashing when I chatted with a friend on facebook. It only happens when receiving messages with smileys :) and when the Chat... Options... "Play Sound for New Messages" option is enabled. So turn that off if you experience this bug.

Tuesday, January 19, 2010

Use vlc to find the title number for mplayer, or, Disney Sucks

Some studios (Disney is one of the worst) put stupid copy protection measures on their DVDs that make them difficult to play on anything but a DVD player. That's a great way to tick off your completely legitimate paying customers.

One of the common ones is to make something other than the first title the start of the movie, or worse, to put one or more corrupt copies of the start of the movie, then have the actual movie start on title 74 or something. This makes it hard to play the DVDs on Linux with mplayer.

To work around this on a Linux machine, use vlc to find the true start of the movie. File... Open Disc... DVD (menus) and start playing the movie. (Feel free to simply watch the movie at this point). Wait until you get to the first scene. Then in the Playback... Navigation dropdown you can find the title number. Let's say it's 37. Then you should be able to play the movie with mplayer dvd://37

Monday, January 11, 2010

Netflix sucks

Netflix is mostly doing the right things: today they sent me a very specific, very short survey about a movie I just watched. Good, don't waste my time! But they didn't even give me the option to type free text comments about the quality. It's actually something I was interested in and willing to give them some details on.

So I went to the account info page, and got the typical wild goose chase where companies don't want to admit that they won't let you email them. So now you've wasted my time when I was trying to help you out. That turned me from a happy, engaged customer into an annoyed one without an outlet. So it goes on the blog instead, and costs you other customers.