[Tutor] myown.getfilesystemencoding()

Oscar Benjamin oscar.j.benjamin at gmail.com
Sat Aug 31 15:16:39 CEST 2013


On 30 August 2013 17:39, eryksun <eryksun at gmail.com> wrote:
> On Fri, Aug 30, 2013 at 11:04 AM, Albert-Jan Roskam <fomcl at yahoo.com> wrote:
>
>> the function returns 850 (codepage 850) when I run it via the command prompt,
>> but 1252 (cp1252) when I run it in my IDE (Spyder).
>
> Maybe Spyder communicates with python.exe as a subprocess in a hidden
> console, with the console's codepage set to 1252. You can use ctypes
> to check windll.kernel32.GetConsoleCP(). If a console is attached,
> this will return a nonzero value.

Spyder has both an internal interpreter and an external interpreter.
One is the same interpreter process that runs the Spyder GUI. The
other is run in a subprocess which keeps the GUI safe but reduces your
ability to inspect the workspace data via the GUI. So presumable
Albert means the "external" interpreter here. Also Spyder has the
option to use ipython as the shell for (I think) either interpreter
and ipython does a lot of weirdness to stdin/stdout etc. (according to
the complaints of the Spyder author when users asked for ipython
support).


Oscar


More information about the Tutor mailing list