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
Alternative fix for #58 (double close bug) #60
Conversation
if hasattr(client, 'detach'): | ||
client_fd = client.detach() | ||
else: | ||
client_fd = _ORIGINAL_DUP(client.fileno()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When that may happen?
Should it use fileno
at all in this case when it leads to known bugs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what the dup is for, there would be two numbers for the have underlying resource. So there won't be a double close since there would be two different numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, true, didn't noticed that. Thanks
d01185d
to
2672ad6
Compare
Codecov Report
@@ Coverage Diff @@
## master #60 +/- ##
==========================================
+ Coverage 81.91% 82.87% +0.96%
==========================================
Files 6 6
Lines 1261 1285 +24
Branches 135 140 +5
==========================================
+ Hits 1033 1065 +32
+ Misses 187 181 -6
+ Partials 41 39 -2
Continue to review full report at Codecov.
|
Ref #58.