
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2014-07-16 22:47 byterry.reedy, last changed2022-04-11 14:58 byadmin.
| Messages (7) | |||
|---|---|---|---|
| msg223292 -(view) | Author: Terry J. Reedy (terry.reedy)*![]() | Date: 2014-07-16 22:47 | |
sys.stdin on 3.4.1 is also 'missing' (among public names) 'line_buffering' (True) and 'mode' ('r'). It seems that these could be trivially added, so the focus of this issue is 'buffer'. The associated .detach method is a no-op, (It is also a bit dangerous for interactive operation.)3.4.1 Console interpreter:>>> import sys; b = sys.stdin.buffer.readline()a line>>> bb'a line\r\n'3.4.1 Idle:>>> import sys; b = sys.stdin.buffer.readline()Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> import sys; b = sys.stdin.buffer.readline()AttributeError: 'PseudoInputFile' object has no attribute 'buffer'https://docs.python.org/3/library/sys.html#sys.stdinpresents the idiom. It also warns (too narrowly -- 'if you are writing a library ...') that it might not.As far as I could find, the Idle doc does not mention the standard streams, let alone Idle specific limitations.I intentionally wrote the title as a statement of a problematical situation, rather than as a proposed solution, as there are two: change code and change doc.Code: add .buffer as a bytes-oriented Pseudofile.Doc: at least mention that standard streams are replaced by objects that ship text between processes, and use gui for input and display, and the consiquences of this. | |||
| msg251492 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2015-09-24 07:10 | |
New changesetac6ade0c5927 by Terry Jan Reedy in branch '2.7':Issue 21995: Explain some differences between IDLE and console Python.https://hg.python.org/cpython/rev/ac6ade0c5927New changesetca6c9cc77c20 by Terry Jan Reedy in branch '3.4':Issue 21995: Explain some differences between IDLE and console Python.https://hg.python.org/cpython/rev/ca6c9cc77c20 | |||
| msg251496 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2015-09-24 07:24 | |
https://docs.python.org/3/library/io.html#io.TextIOBase.buffer"""bufferThe underlying binary buffer (a BufferedIOBase instance) that TextIOBase deals with. This is not part of the TextIOBase API and may not exist in some implementations."""It is common to replace standard streams with StringIO. | |||
| msg251505 -(view) | Author: Terry J. Reedy (terry.reedy)*![]() | Date: 2015-09-24 10:39 | |
I believe this issue was derived from another were someone complained about something else being missing. I will just look into the other two and see if they are supposed to be there. | |||
| msg251824 -(view) | Author: Terry J. Reedy (terry.reedy)*![]() | Date: 2015-09-29 06:43 | |
Related#23220 has draft of part of what pushed. I want to do more on the subject. | |||
| msg252013 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2015-10-01 09:33 | |
Yet one example of test stream that has no buffer - stdprinter used as sys.stderr on early stage of Python startup. | |||
| msg359556 -(view) | Author: Terry J. Reedy (terry.reedy)*![]() | Date: 2020-01-07 22:29 | |
I changed title to 'review' (TextIOBase doc and StringIO as a pure text implementation). | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:06 | admin | set | github: 66194 |
| 2020-01-07 22:29:45 | terry.reedy | set | title: Idle: pseudofiles have no buffer attribute. -> Idle: review 'missing' attributes of pseudofiles messages: +msg359556 versions: + Python 3.9, - Python 2.7, Python 3.4, Python 3.5 |
| 2015-10-01 09:33:09 | serhiy.storchaka | set | messages: +msg252013 |
| 2015-09-29 06:43:12 | terry.reedy | set | assignee:docs@python ->terry.reedy messages: +msg251824 |
| 2015-09-24 10:39:50 | terry.reedy | set | messages: +msg251505 |
| 2015-09-24 07:24:22 | serhiy.storchaka | set | nosy: +serhiy.storchaka messages: +msg251496 |
| 2015-09-24 07:10:28 | python-dev | set | nosy: +python-dev messages: +msg251492 |
| 2014-07-16 22:47:30 | terry.reedy | create | |