classification
Title: StringIO failure when reading a chunk of text without newlines
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: alexandre.vassalotti, benjamin.peterson, pitrou
Priority: normal Keywords:

Created on 2009-02-14 22:31 by pitrou, last changed 2009-03-04 21:38 by benjamin.peterson. 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
2009-03-04 21:38:57benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg83144
nosy: + benjamin.peterson
2009-02-14 22:31:40pitroucreate