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 ocean-city
Recipients ocean-city
Date 2008-09-01.12:03:07
SpamBayes Score 5.961956e-08
Marked as misclassified No
Message-id <1220270588.45.0.0695448735746.issue3748@psf.upfronthosting.co.za>
In-reply-to
Content
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()
History
Date User Action Args
2008-09-01 12:03:08ocean-citysetrecipients: + ocean-city
2008-09-01 12:03:08ocean-citysetmessageid: <1220270588.45.0.0695448735746.issue3748@psf.upfronthosting.co.za>
2008-09-01 12:03:07ocean-citylinkissue3748 messages
2008-09-01 12:03:07ocean-citycreate