Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
994c7f76
Commit
994c7f76
authored
Nov 12, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.4 (#22849)
parents
c216c486
6c14f231
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
Lib/test/test_io.py
Lib/test/test_io.py
+16
-0
Misc/NEWS
Misc/NEWS
+2
-0
Modules/_io/textio.c
Modules/_io/textio.c
+1
-1
No files found.
Lib/test/test_io.py
View file @
994c7f76
...
...
@@ -2856,6 +2856,22 @@ class TextIOWrapperTest(unittest.TestCase):
self
.
assertEqual
(
t
.
read
(
200
),
bytes_val
.
decode
(
'utf-8'
))
def
test_issue22849
(
self
):
class
F
(
object
):
def
readable
(
self
):
return
True
def
writable
(
self
):
return
True
def
seekable
(
self
):
return
True
for
i
in
range
(
10
):
try
:
self
.
TextIOWrapper
(
F
(),
encoding
=
'utf-8'
)
except
Exception
:
pass
F
.
tell
=
lambda
x
:
0
t
=
self
.
TextIOWrapper
(
F
(),
encoding
=
'utf-8'
)
class
MemviewBytesIO
(
io
.
BytesIO
):
'''A BytesIO object whose read method returns memoryviews
rather than bytes'''
...
...
Misc/NEWS
View file @
994c7f76
...
...
@@ -188,6 +188,8 @@ Library
-
Issue
#
22578
:
Added
attributes
to
the
re
.
error
class
.
-
Issue
#
22849
:
Fix
possible
double
free
in
the
io
.
TextIOWrapper
constructor
.
-
Issue
#
12728
:
Different
Unicode
characters
having
the
same
uppercase
but
different
lowercase
are
now
matched
in
case
-
insensitive
regular
expressions
.
...
...
Modules/_io/textio.c
View file @
994c7f76
...
...
@@ -1061,7 +1061,7 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
}
/* Finished sorting out the codec details */
Py_
DECREF
(
codec_info
);
Py_
CLEAR
(
codec_info
);
self
->
buffer
=
buffer
;
Py_INCREF
(
buffer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment