[ python-Bugs-928297 ] platform.libc_ver() fails on Cygwin
SourceForge.net
noreply at sourceforge.net
Fri Apr 2 09:56:28 EST 2004
Bugs item #928297, was opened at 2004-04-02 23:55
Message generated for change (Settings changed) made by quiver
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=928297&group_id=5470
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: George Yoshida (quiver)
>Assigned to: M.-A. Lemburg (lemburg)
Summary: platform.libc_ver() fails on Cygwin
Initial Comment:
>>> import platform
>>> platform.libc_ver()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.3/platform.py", line 134, in libc_ver
f = open(executable,'rb')
IOError: [Errno 2] No such file or
directory: '/usr/bin/python'
The problem is that on Cygwin sys.executable
returns /path/to/python, but since Cygwin is running on
Windows, sys.executable is a symbolic link
to /path/to/python.exe.
>>> import os, sys
>>> os.path.exists(sys.executable)
True
>>> os.path.isfile(sys.executable)
True
>>> file(sys.executable)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
IOError: [Errno 2] No such file or
directory: '/usr/bin/python'
>>> os.path.islink(sys.executable)
True
>>> os.path.realpath(sys.executable)
'/usr/bin/python2.3.exe'
>>> file(sys.executable + '.exe')
<open file '/usr/bin/python.exe', mode 'r' at 0xa100ca0>
Following is the info about the machine I tested:
>>> from platform import *
>>> platform()
'CYGWIN_NT-5.0-1.5.7-0.109-3-2-i686-32bit'
>>> python_compiler()
'GCC 3.3.1 (cygming special)'
>>> python_build()
(1, 'Dec 30 2003 08:29:25')
>>> python_version()
'2.3.3'
>>> uname()
('CYGWIN_NT-5.0', 'my_user_name', '1.5.7
(0.109/3/2)', '2004-01-30 19:32', 'i686', '')
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=928297&group_id=5470
More information about the Python-bugs-list
mailing list