Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9713321f
Commit
9713321f
authored
Feb 02, 2012
by
Petri Lehtinen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document absoluteness of sys.executable
Closes #13402.
parent
03c29f90
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
Doc/library/sys.rst
Doc/library/sys.rst
+4
-2
Lib/test/test_sys.py
Lib/test/test_sys.py
+3
-0
Misc/NEWS
Misc/NEWS
+2
-0
Python/sysmodule.c
Python/sysmodule.c
+1
-1
No files found.
Doc/library/sys.rst
View file @
9713321f
...
...
@@ -202,8 +202,10 @@ always available.
.. data:: executable
A string giving the name of the executable binary for the Python interpreter, on
systems where this makes sense.
A string giving the absolute path of the executable binary for the Python
interpreter, on systems where this makes sense. If Python is unable to retrieve
the real path to its executable, :data:`sys.executable` will be an empty string
or ``None``.
.. function:: exit([arg])
...
...
Lib/test/test_sys.py
View file @
9713321f
...
...
@@ -532,6 +532,9 @@ class SysModuleTest(unittest.TestCase):
self
.
assertEqual
(
out
,
b'?'
)
def
test_executable
(
self
):
# sys.executable should be absolute
self
.
assertEqual
(
os
.
path
.
abspath
(
sys
.
executable
),
sys
.
executable
)
# Issue #7774: Ensure that sys.executable is an empty string if argv[0]
# has been set to an non existent program name and Python is unable to
# retrieve the real program name
...
...
Misc/NEWS
View file @
9713321f
...
...
@@ -454,6 +454,8 @@ Extension Modules
Documentation
-------------
- Issue #13402: Document absoluteness of sys.executable.
- Issue #13883: PYTHONCASEOK also used on OS X and OS/2.
- Issue #12949: Document the kwonlyargcount argument for the PyCode_New
...
...
Python/sysmodule.c
View file @
9713321f
...
...
@@ -1263,7 +1263,7 @@ version_info -- version information as a named tuple\n\
hexversion -- version information encoded as a single integer
\n
\
copyright -- copyright notice pertaining to this interpreter
\n
\
platform -- platform identifier
\n
\
executable --
pathname of this
Python interpreter
\n
\
executable --
absolute path of the executable binary of the
Python interpreter
\n
\
prefix -- prefix used to find the Python library
\n
\
exec_prefix -- prefix used to find the machine-specific Python library
\n
\
float_repr_style -- string indicating the style of repr() output for floats
\n
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment