-
Notifications
You must be signed in to change notification settings - Fork 32
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
TelnetWriter.is_closing()
raises AttributeError
after TelnetWriter.close()
was called.
#62
Comments
I have addressed this in cecceb8, related, #47 that we should not derive from StreamWriter. The "circular reference " problem is with the undocumented _waiter_closed and _waiter_connected futures, which are used for tests, they are setting future value of "self" to workaround the difficulty of getting a handle on these things in unit tests, I hope to provide basic general purpose or several specific awaitable methods, like "wait_for_naws()", written about here https://github.com/jquast/telnetlib3/blob/master/DESIGN.rst#wait_for_negotiation, so that I can remove those things and special code in close() method entirely. |
Closed by release of 2.0.1 https://telnetlib3.readthedocs.io/en/master/history.html#history Thanks again @jonathanslenders I'm a big fan of your work, may you have a great summer and write some great new codes :) |
Hi @jquast, thanks for telnetlib3!
It looks like calling
TelnetWriter.close()
setsTelnetWriter._protocol
toNone
.Because of this, calling
TelnetWriter.is_closing()
after this raises anAttributeError
.According to the Python docs,
is_closing()
should returnTrue
afterclose()
was called. It should not raise anAttributeError
: https://docs.python.org/3/library/asyncio-stream.html#asyncio.StreamWriter.is_closingWhat I don't understand is the need here to break circular refs. Asyncio's
StreamWriter
doesn't do it either. Changing the type of a field from the base class fromprotocols.BaseProtocol
toOptional[protocols.BaseProtocol]
is a Liskov violation.edit:
Similar,
.wait_closed()
can fail with anAttributeError
too:The text was updated successfully, but these errors were encountered: