-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
TypeError in URL.with_query #24
Comments
I prefer first option: casting |
Yes, I'll send pr today or tomorrow |
@dyus please elaborate.
Result is a dict with single key and list as value.
|
You mean n [5]: u = yarl.URL('http://123/')
In [6]: u.with_query(multidict.MultiDict({'a': [1,2,3]}))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-6675a96330d2> in <module>()
----> 1 u.with_query(multidict.MultiDict({'a': [1,2,3]}))
/Users/a.zdanchuk/Envs/mobile_api/lib/python3.5/site-packages/yarl/__init__.py in with_query(self, *args, **kwargs)
673 # v = '&'.join([str(i) for i in v])
674 else:
--> 675 raise TypeError("Invalid variable type")
676 lst.append(quoter(k)+'='+quoter(v))
677 query = '&'.join(lst)
TypeError: Invalid variable type |
I don't want to support list values but added more verbose error messages: 4b9a94a |
Hello, I have a problem with generating query_params. I try to make query
and got TypeError
After some research I understand that Mapping with key: Sequence works with
MultiDict
. But this is not obvious. Maybe it should castdict
intoMultiDict
or return more descriptive warning or add logic for parsing Sequences in Mapping sectionThe text was updated successfully, but these errors were encountered: