classification
Title: io.BufferedWriter shows wrong type in argument error message
Type: behavior Stage: resolved
Components: Versions: Python 3.4, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: mjacob, pitrou, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2013-02-22 11:51 by mjacob, last changed 2013-02-24 03:23 by r.david.murray. This issue is now closed.

Files
File name Uploaded Description Edit
issue17275.diff mjacob, 2013-02-22 11:59 review
issue17275_with_test.diff mjacob, 2013-02-22 16:54 review
Messages (6)
msg182660 - (view) Author: Manuel Jacob (mjacob) * Date: 2013-02-22 11:51
>>> import io
>>> io.BufferedWriter(io.BytesIO(), 1024, 1024, 1024)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: BufferedReader() takes at most 2 arguments (4 given)

It should be "BufferedWriter()" instead of "BufferedReader()".
msg182661 - (view) Author: Manuel Jacob (mjacob) * Date: 2013-02-22 11:59
The attached patch fixes the issue. Should I write a test?
msg182665 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-02-22 13:37
That would be great.  Use assertRaisesRegex and check that the correct name is in the message string.
msg182673 - (view) Author: Manuel Jacob (mjacob) * Date: 2013-02-22 16:54
Added a new patch including tests for the C implementations of BufferedWriter and BufferedRandom.
msg182849 - (view) Author: Roundup Robot (python-dev) Date: 2013-02-24 03:22
New changeset d6a26cd93825 by R David Murray in branch '3.2':
#17275: Fix class name in init errors in C bufferedio classes.
http://hg.python.org/cpython/rev/d6a26cd93825

New changeset aae2bb2e3195 by R David Murray in branch '3.3':
Merge #17275: Fix class name in init errors in C bufferedio classes.
http://hg.python.org/cpython/rev/aae2bb2e3195

New changeset df57314b93d1 by R David Murray in branch '2.7':
#17275: Fix class name in init errors in C bufferedio classes.
http://hg.python.org/cpython/rev/df57314b93d1

New changeset 96f08a22f562 by R David Murray in branch 'default':
Merge #17275: Fix class name in init errors in C bufferedio classes.
http://hg.python.org/cpython/rev/96f08a22f562
msg182850 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-02-24 03:23
Thanks, Manuel.
History
Date User Action Args
2013-02-24 03:23:57r.david.murraysetstatus: open -> closed
versions: + Python 2.7
messages: + msg182850

resolution: fixed
stage: patch review -> resolved
2013-02-24 03:22:15python-devsetnosy: + python-dev
messages: + msg182849
2013-02-22 16:54:20mjacobsetfiles: + issue17275_with_test.diff

messages: + msg182673
2013-02-22 13:37:11r.david.murraysetnosy: + r.david.murray, pitrou

messages: + msg182665
stage: patch review
2013-02-22 11:59:55mjacobsetfiles: + issue17275.diff
keywords: + patch
messages: + msg182661
2013-02-22 11:51:50mjacobcreate