[issue3748] [py3k] platform.architecture() prints vogus messege on windows
New submission from Hirokazu Yamamoto [EMAIL PROTECTED]: As title, platform.architecture() prints vogus messege. import platform platform.architecture() 指定されたパスが見つかりません。 ('32bit', 'WindowsPE') It says speicied path is not found. -- components: Library (Lib) messages: 72227 nosy: ocean-city severity: normal status: open title: [py3k] platform.architecture() prints vogus messege on windows versions: Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3748 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3748] [py3k] platform.architecture() prints vogus messege on windows
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment: This difference between trunk and py3k would go down to this. import os os.popen(r'file e:\python-dev\py3k\PC\VC6\python_d.exe 2 /dev/null') trunk prints nothing, but py3k prints that message. I don't know which is popen's correct behavior, we can supress this message by using subprocess.Popen instead. Index: Lib/platform.py === --- Lib/platform.py (revision 66090) +++ Lib/platform.py (working copy) @@ -110,7 +110,7 @@ __version__ = '1.0.6' -import sys, os, re +import sys, os, re, subprocess ### Platform specific APIs @@ -942,7 +942,7 @@ target = _follow_symlinks(target) try: -f = os.popen('file %s 2 /dev/null' % target) +f = subprocess.Popen('file %s 2 /dev/null' % target, stdout=subprocess .PIPE, stderr=subprocess.PIPE).stdout except (AttributeError,os.error): return default output = f.read().strip() ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3748 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3748] [py3k] platform.architecture() prints vogus messege on windows
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: The call to _syscmd_file() should be avoided on windows platforms: - the file program does not exist - the stderr is redirected to /dev/null, which does not necessarily exists! On my machine, there is a c:\dev directory. Now it contains a file named null, which content is 'file' is not recognized as an internal or external command, operable program or batch file. No comment. -- nosy: +amaury.forgeotdarc ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3748 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com