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
b487e632
Commit
b487e632
authored
Mar 21, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stringio doesn't have an encoding
parent
16f966ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
Lib/_pyio.py
Lib/_pyio.py
+4
-0
Lib/test/test_memoryio.py
Lib/test/test_memoryio.py
+1
-1
Modules/_stringio.c
Modules/_stringio.c
+1
-1
No files found.
Lib/_pyio.py
View file @
b487e632
...
@@ -1834,3 +1834,7 @@ class StringIO(TextIOWrapper):
...
@@ -1834,3 +1834,7 @@ class StringIO(TextIOWrapper):
# TextIOWrapper tells the encoding in its repr. In StringIO,
# TextIOWrapper tells the encoding in its repr. In StringIO,
# that's a implementation detail.
# that's a implementation detail.
return
object
.
__repr__
(
self
)
return
object
.
__repr__
(
self
)
@
property
def
encoding
(
self
):
return
None
Lib/test/test_memoryio.py
View file @
b487e632
...
@@ -451,7 +451,7 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
...
@@ -451,7 +451,7 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
# These are just dummy values but we nevertheless check them for fear
# These are just dummy values but we nevertheless check them for fear
# of unexpected breakage.
# of unexpected breakage.
self
.
assert
Equal
(
memio
.
encoding
,
"utf-8"
)
self
.
assert
True
(
memio
.
encoding
is
None
)
self
.
assertEqual
(
memio
.
errors
,
"strict"
)
self
.
assertEqual
(
memio
.
errors
,
"strict"
)
self
.
assertEqual
(
memio
.
line_buffering
,
False
)
self
.
assertEqual
(
memio
.
line_buffering
,
False
)
...
...
Modules/_stringio.c
View file @
b487e632
...
@@ -665,7 +665,7 @@ stringio_encoding(StringIOObject *self, void *context)
...
@@ -665,7 +665,7 @@ stringio_encoding(StringIOObject *self, void *context)
{
{
CHECK_INITIALIZED
(
self
);
CHECK_INITIALIZED
(
self
);
CHECK_CLOSED
(
self
);
CHECK_CLOSED
(
self
);
return
PyUnicode_FromString
(
"utf-8"
)
;
Py_RETURN_NONE
;
}
}
static
PyObject
*
static
PyObject
*
...
...
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