Am 29.11.2011 23:08, schrieb Martin Gamwell Dawids:
Not sure what the right solution is, but maybe "PyInstaller/ compat.py"'s handling of environment variables should be changed along these lines:
PyInstaller.compat is exactly the place where incompatibilities between OSes should be handled.
I just introduced it yesterday and was not able to finish.
+ + # The variable is not deleted from the environment unless function + # 'os.unsetenv()' exists. If it does not, we set it to the empty string. + if not hasattr(os, 'unsetenv') and hasattr(os, 'putenv'): + os.putenv(name, '')
Shouldn't this have the same effect? os.environ[name] = "" del os.environ[name]
Function "os.unsetenv" appeared in 2.5 and deleting entries from "os.environ" calls this function automatically if it exists. http://docs.python.org/release/2.5/lib/os-procinfo.html
I'm curious: os.unsetenv was undocumented until Py 2.5, but available in older versions of Python, too. I just checked with Python 2.2.
Aha: Introduced in Py 2.2: http://hg.python.org/cpython/rev/20551 (release ov Py 2.2 is rev/22671.
-- Schönen Gruß - Regards Hartmut Goebel Dipl.-Informatiker (univ.), CISSP, CSSLP Goebel Consult Spezialist für IT-Sicherheit in komplexen Umgebungen http://www.goebel-consult.de Monatliche Kolumne: http://www.cissp-gefluester.de/ Goebel Consult ist Mitglied bei http://www.7-it.de -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyinstaller?hl=en.
