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
f56bc9e1
Commit
f56bc9e1
authored
Jul 28, 2007
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return bytes, not str8.
parent
5c12cf2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Modules/cStringIO.c
Modules/cStringIO.c
+7
-7
No files found.
Modules/cStringIO.c
View file @
f56bc9e1
...
@@ -118,8 +118,8 @@ PyDoc_STRVAR(IO_getval__doc__,
...
@@ -118,8 +118,8 @@ PyDoc_STRVAR(IO_getval__doc__,
static
PyObject
*
static
PyObject
*
IO_cgetval
(
PyObject
*
self
)
{
IO_cgetval
(
PyObject
*
self
)
{
if
(
!
IO__opencheck
(
IOOOBJECT
(
self
)))
return
NULL
;
if
(
!
IO__opencheck
(
IOOOBJECT
(
self
)))
return
NULL
;
return
Py
String
_FromStringAndSize
(((
IOobject
*
)
self
)
->
buf
,
return
Py
Bytes
_FromStringAndSize
(((
IOobject
*
)
self
)
->
buf
,
((
IOobject
*
)
self
)
->
pos
);
((
IOobject
*
)
self
)
->
pos
);
}
}
static
PyObject
*
static
PyObject
*
...
@@ -136,7 +136,7 @@ IO_getval(IOobject *self, PyObject *args) {
...
@@ -136,7 +136,7 @@ IO_getval(IOobject *self, PyObject *args) {
}
}
else
else
s
=
self
->
string_size
;
s
=
self
->
string_size
;
return
Py
String
_FromStringAndSize
(
self
->
buf
,
s
);
return
Py
Bytes
_FromStringAndSize
(
self
->
buf
,
s
);
}
}
PyDoc_STRVAR
(
IO_isatty__doc__
,
"isatty(): always returns 0"
);
PyDoc_STRVAR
(
IO_isatty__doc__
,
"isatty(): always returns 0"
);
...
@@ -176,7 +176,7 @@ IO_read(IOobject *self, PyObject *args) {
...
@@ -176,7 +176,7 @@ IO_read(IOobject *self, PyObject *args) {
if
(
(
n
=
IO_cread
((
PyObject
*
)
self
,
&
output
,
n
))
<
0
)
return
NULL
;
if
(
(
n
=
IO_cread
((
PyObject
*
)
self
,
&
output
,
n
))
<
0
)
return
NULL
;
return
Py
String
_FromStringAndSize
(
output
,
n
);
return
Py
Bytes
_FromStringAndSize
(
output
,
n
);
}
}
PyDoc_STRVAR
(
IO_readline__doc__
,
"readline() -- Read one line"
);
PyDoc_STRVAR
(
IO_readline__doc__
,
"readline() -- Read one line"
);
...
@@ -214,7 +214,7 @@ IO_readline(IOobject *self, PyObject *args) {
...
@@ -214,7 +214,7 @@ IO_readline(IOobject *self, PyObject *args) {
n
-=
m
;
n
-=
m
;
self
->
pos
-=
m
;
self
->
pos
-=
m
;
}
}
return
Py
String
_FromStringAndSize
(
output
,
n
);
return
Py
Bytes
_FromStringAndSize
(
output
,
n
);
}
}
PyDoc_STRVAR
(
IO_readlines__doc__
,
"readlines() -- Read all lines"
);
PyDoc_STRVAR
(
IO_readlines__doc__
,
"readlines() -- Read all lines"
);
...
@@ -237,7 +237,7 @@ IO_readlines(IOobject *self, PyObject *args) {
...
@@ -237,7 +237,7 @@ IO_readlines(IOobject *self, PyObject *args) {
goto
err
;
goto
err
;
if
(
n
==
0
)
if
(
n
==
0
)
break
;
break
;
line
=
Py
String
_FromStringAndSize
(
output
,
n
);
line
=
Py
Bytes
_FromStringAndSize
(
output
,
n
);
if
(
!
line
)
if
(
!
line
)
goto
err
;
goto
err
;
if
(
PyList_Append
(
result
,
line
)
==
-
1
)
{
if
(
PyList_Append
(
result
,
line
)
==
-
1
)
{
...
@@ -314,7 +314,7 @@ IO_iternext(Iobject *self)
...
@@ -314,7 +314,7 @@ IO_iternext(Iobject *self)
next
=
IO_readline
((
IOobject
*
)
self
,
NULL
);
next
=
IO_readline
((
IOobject
*
)
self
,
NULL
);
if
(
!
next
)
if
(
!
next
)
return
NULL
;
return
NULL
;
if
(
!
Py
String
_GET_SIZE
(
next
))
{
if
(
!
Py
Bytes
_GET_SIZE
(
next
))
{
Py_DECREF
(
next
);
Py_DECREF
(
next
);
PyErr_SetNone
(
PyExc_StopIteration
);
PyErr_SetNone
(
PyExc_StopIteration
);
return
NULL
;
return
NULL
;
...
...
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