Issue 5264: StringIO failure when reading a chunk of text without newlines

Created on 2009-02-14 22:31 by pitrou, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg82131 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-02-14 22:31
>>> f = io.StringIO("a\r\n", newline=None)
>>> f.read(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/antoine/py3k/__svn__/Lib/io.py", line 2007, in read
    res = self._decode_newlines(self._read(n), True)
  File "/home/antoine/py3k/__svn__/Lib/io.py", line 1953, in
_decode_newlines
    return output
UnboundLocalError: local variable 'output' referenced before assignment
msg83144 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-03-04 21:38
This is fixed by the io-c branch merge. (r70152)
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49514
2009-03-04 21:38:57benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg83144
nosy: + benjamin.peterson
2009-02-14 22:31:40pitroucreate