Skip to content

Preserve fourth browser and operating system version components - #137

Open
123qeew wants to merge 1 commit into
selwin:masterfrom
123qeew:fix/preserve-four-part-versions
Open

123qeew wants to merge 1 commit into
selwin:masterfrom
123qeew:fix/preserve-four-part-versions

Conversation

@123qeew

@123qeew 123qeew commented Oct 29, 2026

Copy link
Copy Markdown

parse_operating_system and parse_browser accept patch_minor but omit it when calling parse_version. For example, the existing BlackBerry Torch user agent contains OS version 6.0.0.448, and ua-parser supplies all four components, but UserAgent.os and get_os() return only 6.0.0.

Pass the fourth component through both helpers. Regression tests cover four-part versions, a zero final component, absent final components, and the existing BlackBerry input. Update the three existing BlackBerry display expectations to include the previously lost OS build number.

Validation: python -m unittest discover passes all 59 tests on CPython 3.11 with the project's ua-parser 0.10.0 pin (PyYAML 6.0.3). The baseline passes 55 tests; the updated tests produce four failures before the fix. git diff --check passes. Other Python versions were not run locally.

This fix was found, implemented, and tested with Codex during a source audit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant