We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35063e9 commit bb50fbfCopy full SHA for bb50fbf
pcbasic/compat/win32.py
@@ -57,9 +57,12 @@ def _get_oem_encoding():
57
58
59
# if starting from a console, shell will inherit its codepage
60
-# if starting from the gui (stdin.encoding == None), we're using OEM codepage
+# if starting from the gui (stdin is None), we're using OEM codepage
61
OEM_ENCODING = _get_oem_encoding()
62
-SHELL_ENCODING = sys.stdin.encoding or OEM_ENCODING
+SHELL_ENCODING = None
63
+if sys.stdin:
64
+ SHELL_ENCODING = sys.stdin.encoding
65
+SHELL_ENCODING = SHELL_ENCODING or OEM_ENCODING
66
# there's also an ACP codepage - this seems to be locale.getpreferredencoding()
67
#_ACP_ENCODING = 'cp' + str(cdll.kernel32.GetACP())
68
0 commit comments