Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringIO failure when reading a chunk of text without newlines #49514

Closed
pitrou opened this issue Feb 14, 2009 · 2 comments
Closed

StringIO failure when reading a chunk of text without newlines #49514

pitrou opened this issue Feb 14, 2009 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented Feb 14, 2009

BPO 5264
Nosy @pitrou, @avassalotti, @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2009-03-04.21:38:57.808>
created_at = <Date 2009-02-14.22:31:40.845>
labels = ['type-bug', 'library']
title = 'StringIO failure when reading a chunk of text without newlines'
updated_at = <Date 2009-03-04.21:38:57.807>
user = 'https://github.com/pitrou'

bugs.python.org fields:

activity = <Date 2009-03-04.21:38:57.807>
actor = 'benjamin.peterson'
assignee = 'none'
closed = True
closed_date = <Date 2009-03-04.21:38:57.808>
closer = 'benjamin.peterson'
components = ['Library (Lib)']
creation = <Date 2009-02-14.22:31:40.845>
creator = 'pitrou'
dependencies = []
files = []
hgrepos = []
issue_num = 5264
keywords = []
message_count = 2.0
messages = ['82131', '83144']
nosy_count = 3.0
nosy_names = ['pitrou', 'alexandre.vassalotti', 'benjamin.peterson']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'needs patch'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue5264'
versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']

@pitrou
Copy link
Member Author

pitrou commented Feb 14, 2009

>>> 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

@pitrou pitrou added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Feb 14, 2009
@benjaminp
Copy link
Contributor

This is fixed by the io-c branch merge. (r70152)

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants