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

"loseConnection" in base class "ConnectionMixin" is incompatible with definition in base class "FileDescriptor" #9849

Closed
twisted-trac opened this issue Jun 16, 2020 · 4 comments

Comments

@twisted-trac
Copy link

rodrigc's avatar @rodrigc reported
Trac ID trac#9849
Type defect
Created 2020-06-16 17:34:48Z

In twisted.internet.abstract.FileDescriptor.loseConnection, the loseConnection method
is defined like:

    def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)):

while in twisted.internet._newtls.ConnectionMixin , we have:

  def loseConnection(self):

If I run tox -e mypy in trunk, mypy complains with this:

src/twisted/internet/tcp.py:204:1: error: Definition of "loseConnection" in base class "ConnectionMixin" is incompatible with definition in base class "FileDescriptor"  [misc]

src/twisted/internet/tcp.py:527:1: error: Definition of "loseConnection" in base class "ConnectionMixin" is incompatible with definition in base class "FileDescriptor"  [misc]
src/twisted/internet/tcp.py:780:1: error: Definition of "loseConnection" in base class "ConnectionMixin" is incompatible with definition in base class "FileDescriptor"  [misc]
src/twisted/internet/tcp.py:789:1: error: Definition of "loseConnection" in base class "ConnectionMixin" is incompatible with definition in base class "FileDescriptor"  [misc]

src/twisted/internet/unix.py:243:1: error: Definition of "loseConnection" in base class "ConnectionMixin" is incompatible with definition in base class "FileDescriptor"  [misc]
src/twisted/internet/unix.py:431:1: error: Definition of "loseConnection" in base class "ConnectionMixin" is incompatible with definition in base class "FileDescriptor"  [misc]

It would be good to fix this.

Searchable metadata
trac-id__9849 9849
type__defect defect
reporter__rodrigc rodrigc
priority__normal normal
milestone__publish_types publish types
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__core core
keywords__None None
time__1592328888078225 1592328888078225
changetime__1594360403322407 1594360403322407
version__None None
owner__Craig_Rodrigues__rodrigc_____ Craig Rodrigues <rodrigc@...>

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc commented

The signature for loseConnection() was modified here:
081d393

I think changing the signature in this way was wrong.

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc commented

#1292

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc commented

Approved here: #1292 (review)

@twisted-trac
Copy link
Author

rodrigc's avatar @rodrigc set owner to @rodrigc
@rodrigc set status to closed

In changeset a0754eb

#!CommitTicketReference repository="" revision="a0754ebc7ec3b527c5d414d84ba575b2284aa90b"
Merge pull request #1292 from twisted/9849-rodrigc-loseconnection-mypy

Remove _connDone parameter from FileDescriptor.loseConnection()

Author: rodrigc
Reviewer: adiroiban
Fixes: ticket:9849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant