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

MultiDict.copy() doesn't work with istr keys #11

Closed
alexdutton opened this issue Sep 22, 2016 · 2 comments
Closed

MultiDict.copy() doesn't work with istr keys #11

alexdutton opened this issue Sep 22, 2016 · 2 comments

Comments

@alexdutton
Copy link

Here's a small test case:

>>> import multidict
>>> m=multidict.CIMultiDict({multidict.istr('Foo'): 'bar'})
>>> m.copy()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "multidict/_multidict.pyx", line 325, in multidict._multidict.MultiDict.copy (multidict/_multidict.c:6830)
  File "multidict/_multidict.pyx", line 251, in multidict._multidict.MultiDict.__init__ (multidict/_multidict.c:5495)
  File "multidict/_multidict.pyx", line 289, in multidict._multidict.MultiDict._extend (multidict/_multidict.c:6115)
TypeError: Expected str, got istr

MultiDict._extend expects every key to be a str. aiohttp.hdrscreates istr objects, so request.headers.copy() doesn't work.

@asvetlov
Copy link
Member

Good catch!
I'll fix it in a few hours.

alexdutton added a commit to ox-it/apiox-core that referenced this issue Sep 22, 2016
@asvetlov
Copy link
Member

Fixed by c79c3a3 and released as `multidict==2.1.1"

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

No branches or pull requests

2 participants