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

TypeError: _request() got an unexpected keyword argument 'cookies' #4

Closed
brandonpaiz opened this issue Apr 3, 2019 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@brandonpaiz
Copy link

I get the following when trying to run socialscan username-2

 27%|████████▍                      | 3/11 [0.19s]SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f4e2ca5a1d0>
transport: <_SelectorSocketTransport fd=11 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 526, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 207, in feed_ssldata
    self._sslobj.unwrap()
  File "/usr/lib/python3.7/ssl.py", line 767, in unwrap
    return self._sslobj.shutdown()
ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2592)
Traceback (most recent call last):                
  File "/usr/bin/socialscan", line 11, in <module>
    load_entry_point('socialscan==0.1.1', 'console_scripts', 'socialscan')()
  File "/usr/lib/python3.7/site-packages/socialscan/__main__.py", line 7, in main
    asyncio.run(cli.main())
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 573, in run_until_complete
    return future.result()
  File "/usr/lib/python3.7/site-packages/socialscan/cli.py", line 87, in main
    platform_response = await future
  File "/usr/lib/python3.7/asyncio/tasks.py", line 533, in _wait_for_one
    return f.result()  # May raise f.exception().
  File "/usr/lib/python3.7/site-packages/socialscan/util.py", line 31, in query
    response = await checkers[platform].check_username(query_str)
  File "/usr/lib/python3.7/site-packages/socialscan/platforms.py", line 237, in check_username
    cookies=cookies) as r:
  File "/usr/lib/python3.7/site-packages/socialscan/platforms.py", line 107, in post
    return self._request("POST", url, **kwargs)
  File "/usr/lib/python3.7/site-packages/socialscan/platforms.py", line 104, in _request
    return self.session.request(method, url, timeout=self.client_timeout, proxy=proxy, **kwargs)
  File "/usr/lib/python3.7/site-packages/aiohttp/client.py", line 223, in request
    return _RequestContextManager(self._request(method, url, **kwargs))
TypeError: _request() got an unexpected keyword argument 'cookies'
@iojw
Copy link
Owner

iojw commented Apr 3, 2019

Hi, this looks like a existing bug in aiohttp (aio-libs/aiohttp#3477) which still occurs for some.

What version of aiohttp and Python are you on?

@iojw iojw added the bug Something isn't working label Apr 3, 2019
@brandonpaiz
Copy link
Author

Hey thanks for getting back so quickly. I upgraded aiohttp from 3.4.4 to 3.5.4 which helped a bit. Now running the same command with Python 3.7.1 on Arch Linux (coloration matches demo):

55%|████████████████▉              | 6/11 [0.36s]SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fe18f669ac8>
transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 526, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 207, in feed_ssldata
    self._sslobj.unwrap()
  File "/usr/lib/python3.7/ssl.py", line 767, in unwrap
    return self._sslobj.shutdown()
ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2592)
----------------------------------------          
               username-2
----------------------------------------
GitLab
Lastfm
Pastebin
GitHub
Reddit
Snapchat
Tumblr
Instagram: Usernames can only use letters, numbers, underscores and periods.
Twitter: Your username can only contain letters, numbers and '_'

Available, Taken/Reserved, Invalid, Error
Completed 9 queries in 1.36s

@iojw
Copy link
Owner

iojw commented Apr 3, 2019

It looks like you were initially facing 2 bugs. The first error (TypeError: _request() got an unexpected keyword argument 'cookies') was due to a feature added in aiohttp v3.5 so you updating fixed that issue.

As for the second error (ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2592)) it appears to be a current bug in aiohttp as seen in the linked issue above so you'll have to wait for a corresponding fix in that repo.

@iojw
Copy link
Owner

iojw commented Jul 8, 2019

@brandonpaiz Looking at the linked issue this problem should be fixed in Python 3.7.4. I’ll close this issue for now, let me know if it still occurs.

@iojw iojw closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants