[SOLVED] Problem running bridge.py

I recently updated my Yun to OpenWrt 1.4.1. Now, I’m getting an error when I invoke bridge.begin() in my sketches and that’s causing the sketch to hang. For example, if I do run-bridge I get a traceback:

root@Arduino6:/usr/lib/python2.7/bridge# exec python -u ./bridge.py
Traceback (most recent call last):
  File "bridge.py", line 32, in <module>
    import packet
  File "/usr/lib/python2.7/bridge/packet.py", line 31, in <module>
    from subprocess import call
  File "/usr/lib/python2.7/subprocess.py", line 432, in <module>
    import pickle
EOFError: EOF read where object expected

So, bridge.py doesn’t get very far and the sketch hangs. Does anyone have any ideas what’s causing this and how to fix it?

The problem appears to be fixed. I ran python -vc 'import pickle' and discovered that pickle.pyc seems to be corrupt. The output from running the command indicated that the first line of pickle.pyc could not be read. So I deleted pickle.pyc and ran the import command again. I noticed that pickle.pyc got rebuilt, but this time it worked. My conclusion is that the original file got buggered when I updated the OpenWrt. I wonder what other files are broken...

For now my sketch is working again. Mike

Thanks @geezerEngineer this post really helped me out:

Was encountering a random EOFError when executing a standard lib module command (e.g. datetime.strptime()). Based on your post I suspected a corrupt compiled python file ...

The fix (drastic) was to delete all *.pyc files from /usr/lib/python2.7

It worked! I was having a really hard time bringing up a new system, and openwrt was crashing frequently. My guess is that it must have crashed in the middle of python first compiling something important ...

Hope this helps someone else