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 2010年07月18日 14:09 by pitrou, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| unsupported.patch | pitrou, 2010年09月03日 19:41 | |||
| Messages (4) | |||
|---|---|---|---|
| msg110648 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年07月18日 14:09 | |
Some of them currently raise IOError. Fortunately, UnsupportedOperation inherits from IOError, which means compatibility can be preserved.
Contrast:
>>> open("LICENSE").write("bar")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: not writable
With:
>>> open("LICENSE", "rb").write(b"")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
io.UnsupportedOperation: write
Or:
>>> io.StringIO().fileno()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
io.UnsupportedOperation: fileno
Or, unfortunately:
>>> open("LICENSE", "rb", buffering=0).write(b"")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: File not open for writing
|
|||
| msg110650 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年07月18日 14:38 | |
Another kind of unsupported operation is non-absolute seeking on a TextIOWrapper:
>>> open("LICENSE").seek(1, 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: can't do nonzero cur-relative seeks
|
|||
| msg115490 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年09月03日 19:41 | |
Here is a patch. |
|||
| msg115677 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年09月05日 23:05 | |
Committed in r84544. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:03 | admin | set | github: 53539 |
| 2010年09月05日 23:05:17 | pitrou | set | status: open -> closed resolution: fixed messages: + msg115677 |
| 2010年09月03日 22:56:15 | pitrou | set | nosy:
+ stutzbach, skrah |
| 2010年09月03日 22:55:51 | pitrou | link | issue7862 superseder |
| 2010年09月03日 19:41:15 | pitrou | set | files:
+ unsupported.patch keywords: + patch messages: + msg115490 |
| 2010年07月18日 14:38:17 | pitrou | set | messages: + msg110650 |
| 2010年07月18日 14:09:29 | pitrou | create | |