Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add type checking in form data #3173

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
revert some
  • Loading branch information
trim21 committed Jun 3, 2024
commit b2032181f520f40b4df41abeb48f80a661cd35b2
9 changes: 1 addition & 8 deletions httpx/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,7 @@ def primitive_value_to_str(value: PrimitiveData) -> str:
return "false"
elif value is None:
return ""
elif isinstance(value, (int, float)):
return str(value)
elif isinstance(value, str):
return value
elif isinstance(value, enum.Enum):
# StrEnum and IntEnum is handled above
return primitive_value_to_str(value.value)
raise TypeError(f"unsupported data type {type(value)}")
return str(value)


def primitive_form_value_to_str(value: FormPrimitiveData) -> str:
Expand Down
Loading