This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年05月18日 18:50 by gregory.p.smith, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 14853.diff | Elena.Oat, 2013年07月06日 16:42 | review | ||
| test_file.patch | vstinner, 2015年01月06日 11:43 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 27694 | merged | iritkatriel, 2021年08月09日 21:51 | |
| PR 27697 | merged | miss-islington, 2021年08月09日 22:38 | |
| PR 27698 | merged | miss-islington, 2021年08月09日 22:38 | |
| Messages (12) | |||
|---|---|---|---|
| msg161073 - (view) | Author: Gregory P. Smith (gregory.p.smith) * (Python committer) | Date: 2012年05月18日 18:50 | |
./python Lib/test/test_file.py # passes ./python Lib/test/test_file.py </dev/null # fails nohup ./python Lib/test/test_file.py # fails ====================================================================== FAIL: testStdin (__main__.COtherFileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_file.py", line 160, in testStdin self.assertRaises((IOError, ValueError), sys.stdin.seek, -1) AssertionError: (<type 'exceptions.IOError'>, <type 'exceptions.ValueError'>) not raised ====================================================================== FAIL: testStdin (__main__.PyOtherFileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_file.py", line 160, in testStdin self.assertRaises((IOError, ValueError), sys.stdin.seek, -1) AssertionError: (<type 'exceptions.IOError'>, <type 'exceptions.ValueError'>) not raised 2.7 only; works fine in 3.2. |
|||
| msg192464 - (view) | Author: Elena Oat (Elena.Oat) * | Date: 2013年07月06日 16:42 | |
testStdin test is useless, it expects that stdin is always unseekable, but since sys.stdin could be any file, i.e. it can be seekable. The patch removes the test. |
|||
| msg192465 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2013年07月06日 16:51 | |
FTR Python 3 raises "io.UnsupportedOperation: underlying stream is not seekable" on unseekable files and "ValueError: negative seek position -1" on seekable ones, whereas Python 2 raises "IOError: [Errno 29] Illegal seek" on unseekable files and doesn't raise anything for seekable ones. |
|||
| msg193619 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年07月23日 21:11 | |
Elena, your patch looks ok to me, thank you. Could you sign a contributor's agreement? http://www.python.org/psf/contrib/ (or have you already done so?) |
|||
| msg193683 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年07月25日 03:25 | |
New changeset 17542d36effd by Ezio Melotti in branch '2.7': #14853: remove test that was making too many assumptions about stdin. Patch by Elena Oat. http://hg.python.org/cpython/rev/17542d36effd New changeset c5d847ee354a by Ezio Melotti in branch '3.3': #14853: remove test that was making too many assumptions about stdin. Patch by Elena Oat. http://hg.python.org/cpython/rev/c5d847ee354a New changeset 1d0ff57e392e by Ezio Melotti in branch 'default': #14853: merge with 3.3. http://hg.python.org/cpython/rev/1d0ff57e392e |
|||
| msg193684 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2013年07月25日 03:25 | |
Fixed, thanks for the patch! |
|||
| msg233527 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2015年01月06日 11:43 | |
The same issue was reported for test_file2k: issue #23168. I modified test_file2k to skip sys.stdin.seek() test if stdin is not a TTY. I prefer to skip a test in a specific case, instead of removing it completly. I propose to add again the test in test_file, with the skip. See test_file.patch for Python 2.7 (I will addapt it to Python 3 if the patch is accepted for Python 2). |
|||
| msg273259 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2016年08月21日 02:22 | |
Long story short: Don’t change Python 2, and just restore the seek(-1) test in 3. I agree in general it is better to skip a test than completely remove it. However, in Python 2, the test that Victor proposes to restore is redundant with test_file2k. Sys.stdin is always a Python-2-style file object, which for some reason or other can allow seek(-1). Also, this bug was opened for Python 2, with the comment "works fine in 3.2". I do not understand why the test was removed from Python 3. For the Python 3 version of the test, the OSF/1 skip should not be necessary. Also, the truncate() test is probably redundant with the test_optional_abilities() method that I added in revision dc9e5f09ac0c (Issue 22854). |
|||
| msg399294 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2021年08月09日 22:38 | |
New changeset 8ed183391241f0c73e7ba7f42b1d49fc02985f7b by Irit Katriel in branch 'main': bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694) https://github.com/python/cpython/commit/8ed183391241f0c73e7ba7f42b1d49fc02985f7b |
|||
| msg399321 - (view) | Author: Łukasz Langa (lukasz.langa) * (Python committer) | Date: 2021年08月10日 13:10 | |
New changeset 897c87045c7435254fd330c6ea48204f056e4afc by Miss Islington (bot) in branch '3.9': bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694) (GH-27698) https://github.com/python/cpython/commit/897c87045c7435254fd330c6ea48204f056e4afc |
|||
| msg399330 - (view) | Author: miss-islington (miss-islington) | Date: 2021年08月10日 14:31 | |
New changeset 4e0147ec50aa62315c5a9aa7c88c181f57aadf42 by Miss Islington (bot) in branch '3.10': bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694) https://github.com/python/cpython/commit/4e0147ec50aa62315c5a9aa7c88c181f57aadf42 |
|||
| msg399331 - (view) | Author: Łukasz Langa (lukasz.langa) * (Python committer) | Date: 2021年08月10日 14:47 | |
Thanks, Irit! ✨ 🍰 ✨ |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:30 | admin | set | github: 59058 |
| 2021年08月10日 14:47:45 | lukasz.langa | set | status: open -> closed messages: + msg399331 assignee: ezio.melotti -> iritkatriel resolution: fixed stage: patch review -> resolved |
| 2021年08月10日 14:31:07 | miss-islington | set | messages: + msg399330 |
| 2021年08月10日 13:10:01 | lukasz.langa | set | nosy:
+ lukasz.langa messages: + msg399321 |
| 2021年08月09日 22:38:40 | miss-islington | set | pull_requests: + pull_request26184 |
| 2021年08月09日 22:38:35 | miss-islington | set | nosy:
+ miss-islington pull_requests: + pull_request26183 |
| 2021年08月09日 22:38:29 | iritkatriel | set | messages: + msg399294 |
| 2021年08月09日 21:52:38 | iritkatriel | set | versions: + Python 3.9, Python 3.10, Python 3.11, - Python 2.7, Python 3.3, Python 3.4 |
| 2021年08月09日 21:51:18 | iritkatriel | set | nosy:
+ iritkatriel pull_requests: + pull_request26180 |
| 2016年08月21日 02:22:06 | martin.panter | set | nosy:
+ martin.panter messages: + msg273259 stage: resolved -> patch review |
| 2015年01月06日 11:43:40 | vstinner | set | files: + test_file.patch |
| 2015年01月06日 11:43:33 | vstinner | set | status: closed -> open nosy: + vstinner messages: + msg233527 resolution: fixed -> (no value) |
| 2013年07月25日 03:25:51 | ezio.melotti | set | status: open -> closed versions: + Python 3.3, Python 3.4 messages: + msg193684 assignee: ezio.melotti resolution: fixed stage: patch review -> resolved |
| 2013年07月25日 03:25:06 | python-dev | set | nosy:
+ python-dev messages: + msg193683 |
| 2013年07月23日 21:11:37 | pitrou | set | messages: + msg193619 |
| 2013年07月06日 16:51:40 | ezio.melotti | set | nosy:
+ ezio.melotti messages: + msg192465 components: + Tests stage: patch review |
| 2013年07月06日 16:42:25 | Elena.Oat | set | files:
+ 14853.diff nosy: + pitrou, Elena.Oat messages: + msg192464 keywords: + patch |
| 2012年05月18日 18:50:06 | gregory.p.smith | create | |