-
Notifications
You must be signed in to change notification settings - Fork 157
Closed as not planned
Closed as not planned
Copy link
Description
Package: ua-parser 1.0.1 (PyPI, released Feb 1 2025)
Issue: UA strings containing the token YaSearchBrowser are incorrectly parsed as Chrome instead of Yandex Browser.
Example
ua = (
"Mozilla/5.0 (Linux; Android 10; TECNO LC7 Build/QP1A.190711.020) "
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.117 "
"Mobile Safari/537.36 YaApp_Android/9.02 YaSearchBrowser/9.02"
)
from ua_parser import parse
print(parse(ua).user_agent.family)
# → 'Chrome' ← should be 'Yandex Browser'Root cause
- The package still bundles
uap-coreat commitd668d6c(uap-core v0.18.0, merged Feb 2024). - Support for
YaSearchBrowserwas added later in fix: update yandex browser regex uap-core#578 (April 2024) along with test coverage. - These UA strings now match the generic Chrome regex before reaching the Yandex-specific rule.
Suggested fix
- Update the embedded
regexes.yamlto the latestuap-core(any commit after PR #578). - Release a patch version (e.g.
1.0.2) to deliver the fix downstream. - Optionally: add the UA string above as a test case to prevent future regressions.
Thanks for maintaining the project!
Metadata
Metadata
Assignees
Labels
No labels