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

Allow inspecting buffering attribute of IO objects #74689

Open
pitrou opened this issue May 29, 2017 · 3 comments
Open

Allow inspecting buffering attribute of IO objects #74689

pitrou opened this issue May 29, 2017 · 3 comments
Labels
3.7 (EOL) end of life topic-IO type-feature A feature request or enhancement

Comments

@pitrou
Copy link
Member

pitrou commented May 29, 2017

BPO 30504
Nosy @pitrou, @benjaminp, @serhiy-storchaka

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 = None
created_at = <Date 2017-05-29.08:59:06.599>
labels = ['type-feature', '3.7', 'expert-IO']
title = 'Allow inspecting buffering attribute of IO objects'
updated_at = <Date 2017-05-31.16:13:25.672>
user = 'https://github.com/pitrou'

bugs.python.org fields:

activity = <Date 2017-05-31.16:13:25.672>
actor = 'pitrou'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['IO']
creation = <Date 2017-05-29.08:59:06.599>
creator = 'pitrou'
dependencies = []
files = []
hgrepos = []
issue_num = 30504
keywords = []
message_count = 3.0
messages = ['294683', '294685', '294849']
nosy_count = 4.0
nosy_names = ['pitrou', 'benjamin.peterson', 'stutzbach', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue30504'
versions = ['Python 3.7']

@pitrou
Copy link
Member Author

pitrou commented May 29, 2017

It would be useful to be able to inspect the buffering attribute of buffered and text I/O objects, especially for debugging.

I would expect e.g.:

>>> sys.stdout.buffering
1   # line-buffered
>>> sys.stdout.buffer.buffering
8192

@pitrou pitrou added 3.7 (EOL) end of life topic-IO type-feature A feature request or enhancement labels May 29, 2017
@serhiy-storchaka
Copy link
Member

>>> sys.stdout.line_buffering
True

For buffered streams I would expect the attribute named "buffer_size", conforming to the name of the parameter of the constructor.

@pitrou
Copy link
Member Author

pitrou commented May 31, 2017

Ah, I had forgotten about the line_buffering attribute. Thank you.

@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
3.7 (EOL) end of life topic-IO type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants