You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Python APIRequestContext silently drops float and bool values supplied through dictionary-based multipart data #43185
The bundled JavaScript implementation handles the corresponding values and converts strings, numbers, and booleans to strings before creating the form field.
As an end-to-end comparison using the bundled Playwright Node runtime:
Confirmed — this is indeed a bug in playwright-python.
In playwright/_impl/_fetch.py (lines 426–438), when multipart is provided as a dictionary, only isinstance(value, str) and is_file_payload(value) were handled, causing int, float, and bool values to fall through and get silently dropped. In contrast, when multipart is a FormData instance, _form_data_field_to_form_field handles (str, int, float, bool).
Thank you, Pavel Feldman (@pavelfeldman) ! Really appreciate the go-ahead. I’ve opened the PR with the fix and regression tests. Please feel free to share any feedback when you have a chance. 🙏
Activity
suraj-self commentedon Oct 7, 2026
If this issue is confirmed as a bug and is suitable for a community contribution, I’d be happy to work on the fix.
alok-108 commentedon Oct 7, 2026
Confirmed — this is indeed a bug in
playwright-python.In
playwright/_impl/_fetch.py(lines 426–438), whenmultipartis provided as a dictionary, onlyisinstance(value, str)andis_file_payload(value)were handled, causingint,float, andboolvalues to fall through and get silently dropped. In contrast, whenmultipartis aFormDatainstance,_form_data_field_to_form_fieldhandles(str, int, float, bool).I've submitted a fix with regression tests on
microsoft/playwright-pythonin PR microsoft/playwright-python#3226.suraj-self commentedon Oct 7, 2026
I have already reproduced and analysed the root cause, implemented and locally verified a minimal fix, including regression tests.
Following Playwright’s contribution guidelines, I held off on opening a PR until the issue could be triaged/approved.
I would like to work on the fix if the issue is approved for community contribution.
pavelfeldman commentedon Oct 7, 2026
Go ahead with the Python fix
suraj-self commentedon Oct 7, 2026
Thank you, Pavel Feldman (@pavelfeldman) ! Really appreciate the go-ahead. I’ve opened the PR with the fix and regression tests. Please feel free to share any feedback when you have a chance. 🙏