Skip to content

fix: serialize non-finite fetch data as null - #3372

Closed
himanshug189-sketch wants to merge 1 commit into
microsoft:mainfrom
himanshug189-sketch:fix-fetch-non-finite-json
Closed

himanshug189-sketch wants to merge 1 commit into
microsoft:mainfrom
himanshug189-sketch:fix-fetch-non-finite-json

Conversation

@himanshug189-sketch

Copy link
Copy Markdown

Description

  • Match JavaScript JSON.stringify behavior by serializing NaN, Infinity, and -Infinity as JSON null in APIRequestContext.fetch(data=...).
  • Apply the conversion recursively to nested dictionaries, lists, and tuples without mutating the input.
  • Add regression coverage for top-level and nested non-finite numbers.

Fixes #3371

Testing

  • python -m pytest tests/async/library/test_browsercontext_fetch.py -v
  • 379 passed, 2 skipped.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

[Bug]: APIRequestContext.fetch fails to serialize NaN and Infinity in data

3 participants