lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removes popen3 deprecated warning (issue 6471043)


From: Phil Holmes
Subject: Re: Removes popen3 deprecated warning (issue 6471043)
Date: Sat, 18 Aug 2012 16:13:54 +0100

----- Original Message ----- From: "Graham Percival" <address@hidden>
To: "Phil Holmes" <address@hidden>
Cc: <address@hidden>; <address@hidden>; <address@hidden>; <address@hidden>; <address@hidden>
Sent: Saturday, August 18, 2012 3:39 PM
Subject: Re: Removes popen3 deprecated warning (issue 6471043)


On Sat, Aug 18, 2012 at 03:31:06PM +0100, Phil Holmes wrote:
My understanding of this problem was that it appeared that Popen (at
some point in the past) would not work with our delivered Python (as
created by Gub).  I also believed that the fix to 1933 also probably
removed this limitation.

No; the fix to 1933 added a special case for win32 to avoid using
subprocess.  See:
 git show ab8dfc

As of 2012 Jan 12, python files produced via GUB could not run
subprocess.  I'm not aware of any work on GUB since then which
might make this possible.  Now, you could look at ab8dfc for
inspiration on how to write a special-case to use the old
os.popen3 version for windows and use subprocess for other
operating systems.  That would remove the deprecation warning when
building on lilydev.

- Graham


OK - so from my bog-standard box, with only lilypond versions of Python:

C:\Users\Phil>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\Windows\System32\WindowsPowerShell\v1.0\;
c:\Program Files (x86)\LilyPondV2.15.95\usr\bin

As you see, the only way python is run is from 2.15.95\usr\bin

C:\Users\Phil>python
Python 2.4.5 (#1, Feb 28 2012, 00:07:03)
[GCC 4.1.1] on mingw32
Type "help", "copyright", "credits" or "license" for more information.
import subprocess
p = subprocess.Popen("notepad", shell=True, stdin=subprocess.PIPE, stdout=su
bprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)


And python on my box happily runs Popen. So either we've done something in the long-lost mists to get round this problem, or it wasn't a problem at all.

Now checking back to emails related to 1933, I wrote:

"As an ugly side-effect, it imported subprocess, which caused our installation to fail as missing msvcrt. For a reason I don't understand, we started shipping msvcrt in the last few releases, "

So we could try to find out when we re-started shipping msvcrt, but you'll see I concluded in January that we do, and I still believe that to be true, based on the above. Sorry, this is a bit of a rambling response, but I've just done the same Python test on an earlier lilypond shipped python:

C:\Users\Phil>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\Windows\System32\WindowsPowerShell\v1.0\;
c:\Program Files (x86)\LilyPondV2.13.31\usr\bin

C:\Users\Phil>python
Python 2.4.5 (#1, Aug  6 2010, 09:30:22)
[GCC 4.1.1] on mingw32
Type "help", "copyright", "credits" or "license" for more information.
import subprocess
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
File "c:\Program Files (x86)\LilyPondV2.13.31\usr\lib\python2.4\subprocess.py"
, line 352, in ?
   import msvcrt
ImportError: No module named msvcrt


So we have fixed it.  You want I should find out when?

--
Phil Holmes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]