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

Minimal deviation from quick-start example fails #3592

Closed
aparamon opened this issue Feb 2, 2019 · 5 comments
Closed

Minimal deviation from quick-start example fails #3592

aparamon opened this issue Feb 2, 2019 · 5 comments

Comments

@aparamon
Copy link

aparamon commented Feb 2, 2019

Long story short

Minimal client example @https://aiohttp.readthedocs.io/en/stable/#getting-started works fine for me. However a minimal deviation printing only status code fails.

Steps to reproduce

import aiohttp
import asyncio

async def fetch(session, url):
    async with session.get(url) as response:
        return response.status

async def main():
    async with aiohttp.ClientSession() as session:
        status = await fetch(session, 'http://python.org')
        print(status)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
200
SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f104a8ea6d8>
transport: <_SelectorSocketTransport fd=8 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:2605)

Your environment

Reproducible both on Debian GNU/Linux and Windows, Python 3.7, aiohttp 3.5.4.

@aio-libs-bot
Copy link

GitMate.io thinks the contributor most likely able to help you is @asvetlov.

Possibly related issues are #2717 ([docs] unittest example fails), #7 (Websocket example fails on Windows), #2148 (Failed tests), #2280 (Test fails on ppc64le), and #2920 (AIOHttp failing after some requests).

@samuelcolvin samuelcolvin removed the bug label Feb 2, 2019
@samuelcolvin
Copy link
Member

Works fine for me, this is nothing to do with adding the print().

Looking at the traceback it appears to be something to do with SSL. Perhaps you have some kind of proxy in place or an issue with your certificates?

@samuelcolvin
Copy link
Member

This seems to be a duplicate of #3535

@aparamon
Copy link
Author

aparamon commented Feb 2, 2019

@samuelcolvin I doubt the problem is in my set-up: the original minimal example using await response.text() works fine for me.
What additional info might be helpful to debug?

@aparamon
Copy link
Author

aparamon commented Feb 2, 2019

Ah indeed, mine is a duplicate.
Thanks for pointing it!

@lock lock bot added the outdated label Feb 2, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants