title: Can't convert to HEX - TypeError: Non-hexadecimal digit found
body: <p>The line <code>deviceToken = deviceToken.replace(' ','').decode('hex')</code> is crashing my script.
  this is the device token: (with a few numbers changed)</p>
  
  <p><code>deviceToken = '9cdcb815 d93e11ce 52baaf6c 14e27cc8 31d5ce62 2e51ce6d f75692c2 3617cadb'</code></p>
  
  <p>The first push notification is sending out fine so I'm sure the device token is ok but after the first event I'm getting this error:</p>
  
  <pre><code>['"INBOX" (UNSEEN 12)'] 
  Sent Push alert.
  Got an event!
  ['"INBOX" (UNSEEN 13)']
  Exception in thread Thread-4:Exception in thread Thread-4:
      Traceback (most recent call last):
        File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner
          self.run()
        File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 483, in run
          self.__target(*self.__args, **self.__kwargs)
        File "server.py", line 111, in idle
          self.dosync()
        File "server.py", line 118, in dosync
          sendPushNotification(numUnseen)
        File "server.py", line 54, in sendPushNotification
          deviceToken = deviceToken.replace(' ','').decode('hex')
        File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
          output = binascii.a2b_hex(input)
      TypeError: Non-hexadecimal digit found
  </code></pre>
  
  <p><a href="https://github.com/gevermann/gmail-iphone-push/blob/master/server/server.py" rel="nofollow">Link to the script</a></p>