[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Tim Golden added the comment: Here's a patch against build_ssl which uses subprocess.check_output and very slightly simplifies the output. It successfully finds ActivePerl and builds from source; and uses the svn export files when it's not. I've targetted the development branch; don't know if there's mileage in backporting. -- keywords: +patch Added file: http://bugs.python.org/file35198/issue10752.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Tim Golden added the comment: I've just looked at issue21141 which is a substantial rework of this area. This change should be incorporated over there as well / instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Zachary Ware added the comment: The patch looks good to me (only tested on a Perl-less machine, though). It applies cleanly on 3.4, which I think is worth committing. It still merges forward cleanly to default, post-#21141. I suspect it would even apply fairly cleanly to 2.7, but I'm not too worried about that backport. -- assignee: - tim.golden stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Roundup Robot added the comment: New changeset 160f32753b0c by Tim Golden in branch '3.4': Issue10752 Be more robust when finding a PERL interpreter to build OpenSSL. Initial patch by Gabi Davar http://hg.python.org/cpython/rev/160f32753b0c New changeset e492d0ac9abb by Tim Golden in branch 'default': Issue10752 Be more robust when finding a PERL interpreter to build OpenSSL. Initial patch by Gabi Davar http://hg.python.org/cpython/rev/e492d0ac9abb -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Tim Golden added the comment: Thanks for the check. Committed to 3.4 default -- resolution: - fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Changes by Tim Golden m...@timgolden.me.uk: -- stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Tim Golden added the comment: Zach -- you've done most of the work on the VS projects lately. Would you mind having a look at this one to see if it's still relevant, please? -- nosy: +zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Zachary Ware added the comment: Still relevant, insofar as having Perl available is relevant. That is, you only need Perl available if you're using vanilla OpenSSL sources, not if you're using sources pulled from svn.python.org (which most people should do, I would think). I have never had a problem with build_ssl.py finding Perl, though. That said, I don't see any harm in properly updating from os.popen to subprocess. See also issue21141, which aims to make explicit that Perl is only needed to doctor up vanilla OpenSSL source. -- versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Waffle Souffle added the comment: Replicated with Perl being discovered as follows: ['C:\\perl\\bin\\perl.exe', 'c:\\cygwin\\bin\\perl.exe', 'c:\\perl\\bin\\perl.exe'] C:\perl\bin\perl.exe is installed from ActivePerl-5.16.3.1603-MSWin32-x86-296746.msi Attempting to compile Python 2.7.6. Installed Python binary used to run build_openssl.py is Python 2.7.1. As mentioned the call to the file handle's close returns 1 for every perl installation. In this version of ActiveState Perl the errorlevel from running Perl with a successful command is 0, and with an unsuccessful command is 2. perl -e use Win32; echo %ERRORLEVEL% == 0 perl -e use Win32x; echo %ERRORLEVEL% == 2 -- nosy: +Waffle.Souffle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Changes by Antoine Pitrou pit...@free.fr: -- assignee: ocean-city - nosy: +tim.peters versions: +Python 3.4 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Gabi Davar added the comment: possibly better patch - uses subprocess' quoting logic for argument handling: diff -r 6fc9103d55f0 PCbuild/build_ssl.py --- a/PCbuild/build_ssl.py Sun Mar 24 14:54:25 2013 -0700 +++ b/PCbuild/build_ssl.py Mon Mar 25 17:28:19 2013 +0200 @@ -47,10 +47,10 @@ # is available. def find_working_perl(perls): for perl in perls: -fh = os.popen('%s -e use Win32;' % perl) -fh.read() -rc = fh.close() -if rc: +import subprocess +try: +subprocess.check_call([perl, '-e', 'use Win32;'], shell=True) +except subprocess.CalledProcessError: continue return perl print(Can not find a suitable PERL:) -- nosy: +Gabi.Davar ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin, tim.golden stage: - patch review versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Sébastien Sablé sa...@users.sourceforge.net added the comment: I had the same issue while compiling Python 2.7 with ActivePerl on windows, and I can confirm that the proposed patch solves the issue. -- nosy: +sable versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
New submission from Sridhar Ratnakumar sridh...@activestate.com: I noticed that despite ActivePerl being installed, `os.popen(...).close()` returned 1 (see find_working_perl in build_ssl.py), while in actuality that command executed successfully with return code 0; I verified this by using the subprocess module. Here's a patch: --- python/PCbuild/build_ssl.py.orig +++ python/PCbuild/build_ssl.py @@ -45,11 +45,11 @@ # Being a Perl dummy, the simplest way I can check is if the Win32 package # is available. def find_working_perl(perls): +import subprocess for perl in perls: -fh = os.popen('%s -e use Win32;' % perl) -fh.read() -rc = fh.close() -if rc: +try: +subprocess.check_call('%s -e use Win32;' % perl, shell=True) +except subprocess.CalledProcessError: continue return perl print(Can not find a suitable PERL:) -- components: Build, Windows messages: 124467 nosy: srid priority: normal severity: normal status: open title: build_ssl.py is relying on unreliable behaviour of os.popen type: compile error versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - ocean-city nosy: +loewis, ocean-city ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10752 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com