GNU bug report logs -
#23095
24.5; python-shell-unbuffered causes problems on Windows
Previous Next
Reported by: Will Wykeham <will <at> wykeham.net>
Date: Tue, 22 Mar 2016 22:18:02 UTC
Severity: normal
Tags: fixed, patch
Merged with 21376
Found in versions 24.5, 25.0.50
Fixed in version 26.1
Done: Noam Postavsky <npostavs <at> users.sourceforge.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 23 March 2016 at 15:46, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> Date: Tue, 22 Mar 2016 15:01:27 +0000
>> From: Will Wykeham <will <at> wykeham.net>
>>
>> (let ((process-environment (python-shell-calculate-process-environment))
>> (code (concat "import sys\n"
>> "print(sys.ps1)")))
>> (with-temp-buffer
>> (let ((code-file (python-shell--save-temp-file code)))
>> (call-process "python" code-file '(t nil) nil "-i")
>> (delete-file code-file))
>> (buffer-string)))
>>
>> In an 'out of the box' emacs, with 'python-shell-unbuffered' set to t as
>> default, this evaluates to an empty string.
>>
>> If python-shell-unbuffered is then set to nil, then the above evaluates to
>> the expected ">>>\n".
>>
>> I haven't got to the bottom of why unbuffered is causing this
>> problem. My suspicion is that it relates to the fact that
>> PYTHONUNBUFFERED on Windows also causes python to process stdin/stdout
>> as binary (which also affects line ending processing).
>
> On Windows, Emacs communicates with subprocesses via pipes, which are
> buffered.
Ah. In which case, it sounds like the appropriate thing would be to
set the default value of 'python-shell-unbuffered' to nil on Windows.
Will
This bug report was last modified 7 years and 174 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.