Closed
Description
Hi.
When I execute program.py for the Day 55-57 example I run into the following Type Error:
File "C:\Users\salro\PycharmProjects\100daysofcode-with-python-course\venv\lib\site-packages\uplink\hooks.py", line 103, in handle_response
response = hook.handle_response(consumer, response)
File "C:\Users\salro\PycharmProjects\100daysofcode-with-python-course\venv\lib\site-packages\uplink\hooks.py", line 20, in wrapper
return hook(*args, **kwargs)
File "C:\Users\salro\PycharmProjects\100daysofcode-with-python-course\venv\lib\site-packages\uplink\returns.py", line 39, in call
return self._strategy(*args, **kwargs)
TypeError: init() takes 1 positional argument but 2 were given
I tried multiple angles I am familiar with but nothing has worked so far.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
bbelderbos commentedon Jan 20, 2021
@salro I cannot reproduce this error, what version of Python are you using and can you post a
pip freeze
here?@mikeckennedy I do hit another issue upon writing a post:
write_post
has this line:But the response json has 3 items:
So it fails with:
I can patch it but waiting for @salro's response on the other issue ...
salro commentedon Jan 20, 2021
Hi @bbelderbos .
I am working on Python 3.9 and here is the pip freeze:
certifi==2020.12.5
chardet==4.0.0
idna==3.1
requests==2.25.1
six==1.15.0
uplink==0.9.3
uritemplate==3.0.1
urllib3==1.26.2
Edit: Also tried it on Python 3.6 with the same error.
Thanks for your help.
bbelderbos commentedon Jan 20, 2021
@salro yeah with
uplink==0.9.3
I am hitting the same issue. Tryuplink==0.4.0
which is actually the "pinned" version in the requirements.txt file, then it should work (apart from the new issue on write which I will PR ...)bbelderbos commentedon Jan 20, 2021
Actually I am a bit confused @mikeckennedy, is the
blog_client.py
complete?resp = svc.create_new_entry(title, content, view_count)
gives me a<Response [200]>
which basically retrieves the 3 articles:(full JSON output from
pdb
pasted above)Could you please check? Thanks
salro commentedon Jan 20, 2021
@bbelderbos I missed the correct version number for uplink. Thanks for pointing it out and I will use the correct one now.
Avoid converting for unknown return types
mikeckennedy commentedon Jul 15, 2021
Hi all. I believe this was a bug in 0.9.3 of uplink. We are now at 0.9.4 and it seems to work again as you would expect. Sorry for the trouble. Incoming update in 3, 2, 1, ...
Fixes talkpython#53 for day 55-57 results in Type Error for __init__ …