gesomax / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

_normalize_headers() does not convert values to string #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Creating a header with an integer value, such as Keep-Alive or
Content-Length will result in a traceback similar to the following:

File '/usr/local/proxycache/httplib2/__init__.py', line 942 in request
  headers = _normalize_headers(headers)
File '/usr/local/proxycache/httplib2/__init__.py', line 194 in
_normalize_headers
  return dict([ (key.lower(), NORMALIZE_SPACE.sub(value, ' ').strip())  for
(key, value) in headers.iteritems()])
File '/usr/local/lib/python2.5/re.py', line 269 in _subx
  template = _compile_repl(template, pattern)
File '/usr/local/lib/python2.5/re.py', line 254 in _compile_repl
  p = sre_parse.parse_template(repl, pattern)
File '/usr/local/lib/python2.5/sre_parse.py', line 700 in parse_template
  s = Tokenizer(source)
File '/usr/local/lib/python2.5/sre_parse.py', line 187 in __init__
  self.__next()
File '/usr/local/lib/python2.5/sre_parse.py', line 189 in __next
  if self.index >= len(self.string):
TypeError: object of type 'int' has no len()

Original issue reported on code.google.com by jamiesonbecker@gmail.com on 2 Dec 2008 at 6:59

GoogleCodeExporter commented 8 years ago

Original comment by joe.gregorio@gmail.com on 13 Jun 2011 at 5:42

GoogleCodeExporter commented 8 years ago
Need additional info or patch?

Original comment by jamiesonbecker@gmail.com on 28 Jul 2011 at 2:50