Subject: Re: bug#21376: 25.0.50; Python tests fail on MS-Windows -- issues with the prompt

From: Noam Postavsky <[email-masked]>
Date: Wed, 16 Aug 2017 12:14:56 -0400

On Wed, Aug 16, 2017 at 10:26 AM, Eli Zaretskii <[email-masked]> wrote:
>
> Thanks, but after applying the patch I still see the same 4 tests
> mentioned above failing.  Do I need to do something in addition to
> just running the test, as in
>
>   cd test && make lisp/progmodes/python-tests.log

Hmm, that's odd, it works for me. Can you check what the following
expressions insert:

(let ((pyfile (make-temp-file "test" nil ".py")))
  (unwind-protect
      (progn (let ((inhibit-eol-conversion nil))
               (with-temp-file pyfile
                 (insert "print('hello world')\n")))
             (call-process "python2" pyfile '(t t) nil
                           "-i" "-u"))
    (delete-file pyfile)))

(let ((pyfile (make-temp-file "test" nil ".py")))
  (unwind-protect
      (progn (let ((inhibit-eol-conversion t))
               (with-temp-file pyfile
                 (insert "print('hello world')\n")))
             (call-process "python2" pyfile '(t t) nil
                           "-i" "-u"))
    (delete-file pyfile)))

I get this for the first (where ^M is really a carriage return character)

    Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40)
      [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>   File "<stdin>", line 1
        print('hello world')^M
                            ^
    SyntaxError: invalid syntax

and this for the second:

    Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40)
      [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> hello world