shon / httpagentparser

Python HTTP Agent Parser
http://pypi.python.org/pypi/httpagentparser/
MIT License
222 stars 55 forks source link

Old opera UserAgent not recognized correctly #59

Closed ewjoachim closed 9 years ago

ewjoachim commented 9 years ago

I experienced a problem when parsing the browser version of a visitor on my website, and it boils down to that :

>>> import httpagentparser
>>> result = httpagentparser.detect("Opera/9.64(Windows NT 5.1; U; en) Presto/2.1.1")
>>> print result
{'platform': {'version': 'XP', 'name': 'Windows'}, 'os': {'version': 'XP', 'name': 'Windows'}, 'browser': {'version': '9.64(Windows', 'name': 'Opera'}}

I think it's because there should be a space between 4 and ( but still, this is an existing Opera user agent (http://www.useragentstring.com/Opera9.64_id_13933.php).

Thank you

shon commented 9 years ago

New release 1.7.6 has the fix. Thanks for reporting.