shon/httpagentparser — Issue #14: user-agent string raises exception
Author: gabor
Created: 2012-02-06 07:46:09+00:00
State: open

the following user-agent string causes an error:

>>> httpagentparser.detect(u'Sogou Mobile Spider1.0 for iPhone Android and Mozilla/5.0')
Traceback (most recent call last):
File "", line 1, in
File "httpagentparser/__init__.py", line 292, in detect
if detector.detect(agent, result):
File "httpagentparser/__init__.py", line 68, in detect
version = self.getVersion(agent)
File "httpagentparser/__init__.py", line 254, in getVersion
return version.replace('_', '.')
UnboundLocalError: local variable 'version' referenced before assignment