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
fe1b22af
Commit
fe1b22af
authored
Apr 29, 2013
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore errors when trying to fetch sys.stdin.encoding (closes #17863)
parent
7d110042
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
Misc/NEWS
Misc/NEWS
+3
-0
Python/pythonrun.c
Python/pythonrun.c
+8
-9
No files found.
Misc/NEWS
View file @
fe1b22af
...
@@ -12,6 +12,9 @@ What's New in Python 3.3.2?
...
@@ -12,6 +12,9 @@ What's New in Python 3.3.2?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #17863: In the interactive console, don'
t
loop
forever
if
the
encoding
can
't be fetched from stdin.
- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
...
...
Python/pythonrun.c
View file @
fe1b22af
...
@@ -1237,16 +1237,15 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
...
@@ -1237,16 +1237,15 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
_Py_IDENTIFIER
(
encoding
);
_Py_IDENTIFIER
(
encoding
);
if
(
fp
==
stdin
)
{
if
(
fp
==
stdin
)
{
/* Fetch encoding from sys.stdin */
/* Fetch encoding from sys.stdin
if possible.
*/
v
=
PySys_GetObject
(
"stdin"
);
v
=
PySys_GetObject
(
"stdin"
);
if
(
v
==
NULL
||
v
==
Py_None
)
if
(
v
&&
v
!=
Py_None
)
{
return
-
1
;
oenc
=
_PyObject_GetAttrId
(
v
,
&
PyId_encoding
);
oenc
=
_PyObject_GetAttrId
(
v
,
&
PyId_encoding
);
if
(
oenc
)
if
(
!
oenc
)
enc
=
_PyUnicode_AsString
(
oenc
);
return
-
1
;
if
(
!
enc
)
enc
=
_PyUnicode_AsString
(
oenc
);
PyErr_Clear
();
if
(
enc
==
NULL
)
}
return
-
1
;
}
}
v
=
PySys_GetObject
(
"ps1"
);
v
=
PySys_GetObject
(
"ps1"
);
if
(
v
!=
NULL
)
{
if
(
v
!=
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