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 2009年02月19日 17:50 by mkc, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (9) | |||
|---|---|---|---|
| msg82486 - (view) | Author: Mike Coleman (mkc) | Date: 2009年02月19日 17:50 | |
$ python3.0 -c 'print((1, 2, 3))' > /dev/full || echo error status
$
This command gives no indication whatsoever that anything has gone
wrong. Following this with strace demonstrates that the interpreter is
in fact ignoring these errors:
2589 write(1, "(1, 2, 3)\n"..., 10) = -1 ENOSPC (No space left on
device)
2589 rt_sigaction(SIGINT, {SIG_DFL}, {0x47aa49, [], SA_RESTORER,
0x7fd5aa9da080}, 8) = 0
2589 write(1, "(1, 2, 3)\n"..., 10) = -1 ENOSPC (No space left on
device)
2589 write(1, "(1, 2, 3)\n"..., 10) = -1 ENOSPC (No space left on
device)
2589 write(1, "(1, 2, 3)\n"..., 10) = -1 ENOSPC (No space left on
device)
2589 exit_group(0) = ?
|
|||
| msg109754 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010年07月09日 15:41 | |
Can anyone with a Linux box please check to see if this is still an issue. |
|||
| msg109759 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2010年07月09日 16:03 | |
Yes, py3k r82745 still shows the problem |
|||
| msg109767 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2010年07月09日 16:39 | |
Yes, it's an issue in py3k. Also, I prefer the behavior of 2.5, but I'm not sure if that can be changed easily in 2.7. $ python2.5 -c 'print((1, 2, 3))' > /dev/full close failed: [Errno 28] No space left on device $ python2.7 -c 'print((1, 2, 3))' > /dev/full close failed in file object destructor: Error in sys.excepthook: Original exception was: $ python3.2 -c 'print((1, 2, 3))' > /dev/full $ |
|||
| msg109772 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2010年07月09日 16:53 | |
The issue is that when close() calls flush(), errors are silently discarded. I'm sure a similar issue was already filed, but could not find it. |
|||
| msg109781 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年07月09日 18:51 | |
> The issue is that when close() calls flush(), errors are silently
> discarded
This has been fixed in 3.1 and 3.2:
$ ./python -c "with open('/dev/full', 'w') as f: print('a', file=f)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 28] No space left on device
However, it seems sys.stdout has a different treatment:
$ ./python -c "print('a')" > /dev/full
$
|
|||
| msg109793 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2010年07月09日 20:31 | |
It looks like the error is cleared in Python/pythonrun.c, line 321: if (fout != NULL && fout != Py_None) { tmp = PyObject_CallMethod(fout, "flush", ""); if (tmp == NULL) PyErr_Clear(); else Py_DECREF(tmp); } Not sure why it isn't handled before that. |
|||
| msg110107 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年07月12日 16:19 | |
I agree that errors while flushing stdout shouldn't be silenced but instead reported (on stderr, obviously :-)). It is especially important when scripts are used for data processing. I'd like to have Guido's opinion, though. |
|||
| msg113338 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2010年08月08日 22:06 | |
Closing as a duplicate of issue 5319. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:45 | admin | set | github: 49571 |
| 2010年08月08日 22:06:04 | skrah | set | status: open -> closed resolution: duplicate superseder: stdout error at interpreter shutdown fails to return OS error status messages: + msg113338 |
| 2010年07月12日 16:19:48 | pitrou | set | nosy:
+ gvanrossum messages: + msg110107 |
| 2010年07月09日 20:31:17 | skrah | set | messages: + msg109793 |
| 2010年07月09日 18:51:17 | pitrou | set | messages: + msg109781 |
| 2010年07月09日 16:53:10 | amaury.forgeotdarc | set | nosy:
+ pitrou messages: + msg109772 |
| 2010年07月09日 16:39:17 | skrah | set | nosy:
+ skrah messages: + msg109767 |
| 2010年07月09日 16:03:07 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages: + msg109759 |
| 2010年07月09日 15:41:34 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg109754 versions: + Python 3.1, Python 2.7, Python 3.2, - Python 3.0 |
| 2009年02月19日 17:50:03 | mkc | create | |