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

Closing a socket when makefile() is used #64081

Closed
vadmium opened this issue Dec 4, 2013 · 4 comments
Closed

Closing a socket when makefile() is used #64081

vadmium opened this issue Dec 4, 2013 · 4 comments
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@vadmium
Copy link
Member

vadmium commented Dec 4, 2013

BPO 19882
Nosy @pitrou, @vadmium

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2013-12-04.20:16:23.946>
created_at = <Date 2013-12-04.07:21:06.143>
labels = ['type-bug', 'docs']
title = 'Closing a socket when makefile() is used'
updated_at = <Date 2013-12-04.20:16:23.945>
user = 'https://github.com/vadmium'

bugs.python.org fields:

activity = <Date 2013-12-04.20:16:23.945>
actor = 'pitrou'
assignee = 'docs@python'
closed = True
closed_date = <Date 2013-12-04.20:16:23.946>
closer = 'pitrou'
components = ['Documentation']
creation = <Date 2013-12-04.07:21:06.143>
creator = 'martin.panter'
dependencies = []
files = []
hgrepos = []
issue_num = 19882
keywords = []
message_count = 4.0
messages = ['205200', '205240', '205243', '205244']
nosy_count = 4.0
nosy_names = ['pitrou', 'docs@python', 'python-dev', 'martin.panter']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue19882'
versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

@vadmium
Copy link
Member Author

vadmium commented Dec 4, 2013

I think the documentation is rather vague about closing the underlying OS socket. Can someone verify if the following is true (asterisked bits are my additions), and maybe update the documentation?

socket.close(): Close the socket *object*. *The underlying file descriptor is also closed, unless there are file objects from makefile() still open.*

socket.makefile(): Closing the file object won’t close the *file descriptor* unless *the original socket object and any other file objects have already been closed*.

@vadmium vadmium added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Dec 4, 2013
@pitrou
Copy link
Member

pitrou commented Dec 4, 2013

Your observations are right, indeed. I'll make the doc changes.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Dec 4, 2013

New changeset e10bb7c1b8f8 by Antoine Pitrou in branch '3.3':
Issue bpo-19882: tweak docs for socket.close()
http://hg.python.org/cpython/rev/e10bb7c1b8f8

@pitrou
Copy link
Member

pitrou commented Dec 4, 2013

Fixed, thanks!

@pitrou pitrou closed this as completed Dec 4, 2013
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants