New submission from Antoine Pitrou <pit...@free.fr>:

Opening an existing file in read-only text mode and trying to write to it:

>>> f = open("LICENSE")
>>> f.write("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: null argument to internal routine

Binary files get it right though:

>>> f = open("LICENSE", "rb")
>>> f.write("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
io.UnsupportedOperation: write

----------
components: IO
messages: 86700
nosy: pitrou
priority: critical
severity: normal
status: open
title: TextIOWrapper: bad error reporting when write() is forbidden
type: behavior
versions: Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5860>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to