This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lkcl
Recipients ggenellina, lkcl, loewis, n
Date 2013-03-19.00:35:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1363653359.67.0.888642846613.issue5051@psf.upfronthosting.co.za>
In-reply-to
Content
hi ned,

well, the situation surrounding the bug-reporting that i was doing at the time was a general campaign of "this person is obviously wasting our time because they're developing yet another port/platform, that is obviously a waste of our time, therefore we will shut him down and ban him from the bugtracker and thus generally make our lives easier".

so against that background i really wasn't inclined to contribute to the development of python.  the argument given for this specific bug [off-list because i had been ordered not to use the bugtracker]  was "it's not a supported combination therefore obviously it's not a bug".

leaving that aside, and assuming that things have moved on from there and that improvements to python and its expansion into areas beyond where it is currently entrenched are welcomed, the arguments given 3 years ago are actually valid... but from a different perspective: the combination of win32 and bash is particularly weird [i.e. borderline] and thus the test is incomplete.

so it would be best i feel to consider what the test is trying to achieve: set environment variables, and then execute a command that results in that environment variable being passed and read back with python's popen command.

in the POSIX case, the easiest way to do that would involve using /bin/sh - a pretty standard baseline application that can be expected to exist on every POSIX platform under the sun.

but the most "generic" case would actually involve compiling a small c application which read - in c - a standard environment variable - and printf'd it then exited.

a quick google search "c getenv" shows a perfect example:
http://msdn.microsoft.com/en-gb/library/aa246422%28v=vs.60%29.aspx

so the *ideal* situation i feel would be to use a shortened version of that, with the env variable "HELLO" printf'd out.  if python popen returns "world", the test can be deemed to be successful.

the less-than-ideal situation would be, rather than to skip the test, to use command.com or cmd.exe under win32 rather than executing /bin/sh...

... but the irony is that even if you did that, you would run into the same bug because the os.environ.clear() destroys the COMSPEC environment variable!

soooOoo.. to fix that, you'd need to record the COMSPEC environment variable just before the os.environ.clear() and re-establish it prior to the popen.

so it's a tricky one!

* the ideal test is to actually compile up some c code.  that would however mean shipping a binary with the python distribution as part of the test suite [eek! there must be other solutions...]

* the less-than-ideal test is to use a pre-existing application, but then you have to work out, on a per-supported-platform basis, an OS-specific method of echoing an environment variable

* the least perfect method is to skip the test entirely on platforms that don't have /bin/sh, but then you have the situation where the regression tests aren't actually doing their job, thus defeating the goal of python being a platform-independent environment because you can't rely on code working across all platforms.

tricky one!
History
Date User Action Args
2013-03-19 00:35:59lkclsetrecipients: + lkcl, loewis, ggenellina, n
2013-03-19 00:35:59lkclsetmessageid: <1363653359.67.0.888642846613.issue5051@psf.upfronthosting.co.za>
2013-03-19 00:35:59lkcllinkissue5051 messages
2013-03-19 00:35:59lkclcreate