Skip to content

fix(python): normalize humanize duration types#682

Open
Cloudymap1e wants to merge 1 commit into
daijro:mainfrom
Cloudymap1e:fix/humanize-config-types
Open

fix(python): normalize humanize duration types#682
Cloudymap1e wants to merge 1 commit into
daijro:mainfrom
Cloudymap1e:fix/humanize-config-types

Conversation

@Cloudymap1e

Copy link
Copy Markdown

Related Issue

Closes #498

Description

Python's bool is a subclass of int, so humanize=True was incorrectly serialized as a numeric duration. Integer durations were also left as integers even though the browser-side configuration parser expects a floating-point value.

This change treats Boolean enablement separately and normalizes numeric durations to float. True enables humanization without writing humanize:maxTime; explicit integer or floating-point durations produce a floating-point maxTime.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Other

Testing

  • python -m pytest pythonlib/tests/test_humanize.py -q: 4 passed
  • python -m pytest pythonlib/tests -q: 47 passed, 4 skipped
  • Real Camoufox 152.0.4-beta.28 launches and mouse movement completed for Boolean, integer, and floating-point configurations
  • Independent static review: PASS, no blocking findings

Fingerprint Report

Not applicable: this corrects Python-side configuration typing and does not change fingerprint patches.

Checklist

  • I have linked a related issue above
  • My changes are focused on a single logical change
  • I have added testing instructions which include the desired result
  • Service tests pass (for python library changes) -./service-tester/run_tests.sh --browser-version official/prerelease/146.0.1-alpha.25 (attach screenshot) temporarily out of service lol
  • Build test passes (for patch changes) - not applicable to this Python-only change

@KittisakPh

Copy link
Copy Markdown

@JWriter20 This critical case or not

@JWriter20

Copy link
Copy Markdown
Collaborator

@JWriter20 This critical case or not

I'll look into it

@JWriter20

JWriter20 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Not critical, just good additional input validation. Turns out its not related to the issue it was linked to tho, it is a genuine bug, but not a big one. I will probably add an additional case for handling if the user passes in 0 as well, as this case is handled as disabling the humanization which is not explicit in its intention (either true/false, or a float is what we want)

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.

Humanize not working on Mac mini (M2) 14.8.1 (23J30)

3 participants