Skip to content

Change python 3.8-dev to python 3.8 in travis#477

Merged
sethmlarson merged 3 commits into
encode:masterfrom
jtmiclat:python-3.8-travis
Oct 20, 2019
Merged

Change python 3.8-dev to python 3.8 in travis#477
sethmlarson merged 3 commits into
encode:masterfrom
jtmiclat:python-3.8-travis

Conversation

@jtmiclat

Copy link
Copy Markdown
Contributor

Change python 3.8-dev to python 3.8 in Travis as python 3.8 is officially released

@sethmlarson

Copy link
Copy Markdown
Contributor

Took 3.8 out of the allow failures list since we need to now support 3.8.

@florimondmanca

florimondmanca commented Oct 16, 2019

Copy link
Copy Markdown
Contributor

@sethmlarson We still have the start_tls() test failing on 3.8, like it did back in #423 - see my #423 (comment).

I spent 30mins trying to debug what it is that we're doing wrong, but I can't seem to find anything. Where did you find the info/resources about how to implement the transport switching (see #263)? Could it be there's something we're missing there?

@florimondmanca

florimondmanca commented Oct 16, 2019

Copy link
Copy Markdown
Contributor

Locally I'm receiving an asyncio error/warning:

ERROR    asyncio:base_events.py:1692 An open stream object is being garbage collected; call "stream.close()" explicitly.

which is emitted by this piece of code. This is a new warning in 3.8 that was contributed here: python/cpython#9201.

The warning is even emitted using:

import asyncio

async def main(host, port):
    stream_reader, stream_writer = await asyncio.wait_for(  # type: ignore
        asyncio.open_connection(host, port), 5
    )
    stream_writer.close()
    del stream_writer  # Simulate garbage collection

asyncio.run(main("localhost", 8000))

By adding await asyncio.sleep(0) just after stream_writer.close() I am able to remove the error; so I added that to our Stream.close() implementation to see what was left.

Well, the error is still there when running the start_tls() test — which makes me think we might not be cleaning up either the old stream_reader or stream_writer properly?

(I also tried the await asyncio.sleep(0) trick inside .start_tls(), i.e. just after we've called start_tls() and obtained a new transport. But the effect is that a ConnectionResetError is raised when we write the request during the test. So… 🤷‍♂)

@florimondmanca florimondmanca added the tooling Changes to our CI/CD, tests setup, etc. label Oct 19, 2019
@florimondmanca

Copy link
Copy Markdown
Contributor

Hi @jtmiclat, now that #484 I believe you can rebase from master and the build with 3.8 should pass. :)

@sethmlarson sethmlarson reopened this Oct 20, 2019
@sethmlarson

Copy link
Copy Markdown
Contributor

Kicked another build off, let's see if we can merge now without a rebase. :)

@sethmlarson
sethmlarson merged commit f68b3df into encode:master Oct 20, 2019
@sethmlarson

Copy link
Copy Markdown
Contributor

@jtmiclat Thank you for this change :) 🎉

Kludex referenced this pull request in pydantic/httpx2 May 11, 2026
The future sucks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling Changes to our CI/CD, tests setup, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants