jacob1044 / pubsubhubbub

Automatically exported from code.google.com/p/pubsubhubbub
Other
1 stars 0 forks source link

Hub does not properly handle unicode etag headers #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
'ascii' codec can't decode byte 0xa4 in position 9: ordinal not in range(128)
Traceback (most recent call last):
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", 
line 513, in __call__
    handler.post(*groups)
  File "/base/data/home/apps/pubsubhubbub/fork-join.342023968506316503/main.py", line 
646, in decorated
    return func(myself, *args, **kwargs)
  File "/base/data/home/apps/pubsubhubbub/fork-join.342023968506316503/main.py", line 
2643, in post
    self._handle_fetches([work])
  File "/base/data/home/apps/pubsubhubbub/fork-join.342023968506316503/main.py", line 
2626, in _handle_fetches
    async_proxy.wait()
  File "/base/data/home/apps/pubsubhubbub/fork-
join.342023968506316503/async_apiproxy.py", line 100, in wait
    self.wait_one()
  File "/base/data/home/apps/pubsubhubbub/fork-
join.342023968506316503/async_apiproxy.py", line 95, in wait_one
    rpc.user_callback(rpc.pbresponse, None)
  File "/base/data/home/apps/pubsubhubbub/fork-
join.342023968506316503/urlfetch_async.py", line 93, in completion_callback
    callback(result, user_exception)
  File "/base/data/home/apps/pubsubhubbub/fork-join.342023968506316503/main.py", line 
2367, in wrapper
    exception)
  File "/base/data/home/apps/pubsubhubbub/fork-join.342023968506316503/main.py", line 
2552, in <lambda>
    feed_record, work, fetch_url, attempts, *args)
  File "/base/data/home/apps/pubsubhubbub/fork-join.342023968506316503/main.py", line 
2606, in callback
    if parse_feed(feed_record, headers, content):
  File "/base/data/home/apps/pubsubhubbub/fork-join.342023968506316503/main.py", line 
2457, in parse_feed
    feed_record.update(headers, header_footer)
  File "/base/data/home/apps/pubsubhubbub/fork-join.342023968506316503/main.py", line 
1276, in update
    self.etag = headers.get('ETag')
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 
503, in __set__
    value = self.validate(value)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 
2200, in validate
    value = self.data_type(value)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore_types.py", 
line 975, in __new__
    return super(Text, cls).__new__(cls, arg, encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa4 in position 9: ordinal 
not in range(128)

Happened with this feed: http://blog.chinatimes.com/rss.aspx

Original issue reported on code.google.com by bslatkin on 17 May 2010 at 11:35

GoogleCodeExporter commented 9 years ago
Fixed in r361

Turns out this isn't unicode, it's just crazy time. This violates the HTTP spec 
(as I read it), so we're going to skip 
these headers completely. I've only ever seen this once.

Original comment by bslatkin on 3 Jun 2010 at 11:21