| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-9831) (GH-9832)
With macOS framework builds, test case test_nonexisting_script in
test_nonexisting_script fails because the test case assumes that
the file name in sys.executable will appear in the error message.
For macOS framework builds, sys.executable is the file name of the
stub launcher and its file name bears no relationship to the file
name of the actual python executable. For now, skip the test in
this case.
(cherry picked from commit f6c29a65e2a6da5c0014c868cf963c975b74e72b)
Co-authored-by: Ned Deily <nad@python.org>
|
|
|
|
|
|
|
| |
Make sure that "./python script.py" does not crash if the script
file doesn't exist.
(cherry picked from commit a46467ff198c42c8f34768c7be4b4562f6f44736)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Historically, -m added the empty string as sys.path
zero, meaning it resolved imports against the current
working directory, the same way -c and the interactive
prompt do.
This changes the sys.path initialisation to add the
*starting* working directory as sys.path[0] instead,
such that changes to the working directory while the
program is running will have no effect on imports
when using the -m switch.
(cherry picked from commit d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b)
|
|
|
|
|
| |
parent isn't a package (GH-1899)
Previously AttributeError was raised, but that's not very reflective of the fact that the requested module can't be found since the specified parent isn't actually a package.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Directory and zipfile execution previously added
the parent directory of the directory or zipfile
as sys.path[0] and then subsequently overwrote
it with the directory or zipfile itself.
This caused problems in isolated mode, as it
overwrote the "stdlib as a zip archive" entry
in sys.path, as the parent directory was
never added.
The attempted fix to that issue in bpo-29319
created the opposite problem in *non*-isolated
mode, by potentially leaving the parent
directory on sys.path instead of overwriting it.
This change fixes the root cause of the problem
by removing the whole "add-and-overwrite" dance
for sys.path[0], and instead simply never adds
the parent directory to sys.path in the first
place.
|
|\ |
|
| |
| |
| |
| | |
Based on patch by Michael Layzell.
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Also try to clarify the find_spec() error message.
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| | |
The original form is incorrect grammar and feels awkward, even though the
meaning is clear.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Issue #26100:
* Add subprocess._optim_args_from_interpreter_flags()
* Add test.support.optim_args_from_interpreter_flags()
* Use new functions in distutils, test_cmd_line_script, test_compileall and
test_inspect
The change enables test_details() test of test_inspect when -O or -OO command
line option is used.
|
| |
|
|
|
|
|
|
|
|
| |
The previous fix only handled the case of the parent package of __main__
failing to initialize.
Also make the "Error while finding spec" formatting slightly more appealing,
and document and test that the module name must be absolute.
|
|
|
|
|
|
|
|
|
|
| |
Initialize package before calling find_spec() for __main__, so that we do not
incorrectly handle exceptions from __init__.py. When runpy is used from the
Python CLI, use an internal exception rather than ImportError, to avoid
catching unexpected exceptions.
Also remove exception message rewriting in _run_module_as_main(), because it
seems to be redundant with the _get_main_module_details() function.
|
|
|
|
| |
Patch by Christie Wilson.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Note that __spec__.name is not currently guaranteed to be in
sys.modules when the code is running, only __name__ is.
The "running module is in sys.modules" invariant will be
expanded to also cover __spec__.name in a subsequent patch.
|
| |
|
|
|
|
| |
Patch by Chris Jerdonek
|
|\
| |
| |
| |
| | |
TESTFN_UNDECODABLE, TESTFN_NONASCII of test.support from Python 3.4. Backport
tests on non-ASCII paths.
|
| |
| |
| |
| |
| | |
TESTFN_NONASCII of test.support from Python 3.4. Backport tests on non-ASCII
paths.
|
| | |
|
| |
| |
| |
| | |
Patch by Serhiy Storchaka.
|
| | |
|
| |
| |
| |
| | |
corresponding type objects
|
| |
| |
| |
| | |
the REPL for a bare 'python' call
|
| |
| |
| |
| | |
by basing pkgutil explicitly on importlib, deprecating its internal import emulation and setting __main__.__loader__ correctly so that runpy still works (Affects #15343, #15314, #15357)
|
|\ \
| |/
| |
| | |
invoked using -m switch. Patch contributed by Jeff Knupp
|
| |
| |
| |
| | |
invoked using -m switch. Patch contributed by Jeff Knupp
|
| |
| |
| |
| | |
Furman)
|
|/
|
|
|
|
|
|
|
|
|
|
| |
be implicit.
Added a warning for when sys.path_hooks is found to be empty. Also
changed the meaning of None in sys.path_importer_cache to represent
trying sys.path_hooks again (an interpretation of previous semantics).
Also added a warning for when None was found.
The long-term goal is for None in sys.path_importer_cache to represent
the same as imp.NullImporter: no finder found for that sys.path entry.
|
|
|
|
| |
test_cmd_line_script (patch by Jason Yeo)
|
| |
|
|
|
|
|
| |
Fix the test if the native filesystem encoding is not utf-8 (eg. cp1250 on
Windows).
|
| |
|
|
|
|
| |
easier writing of unit tests and better error reporting.
|
|
|
|
| |
module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory
|
| |
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78093 | georg.brandl | 2010-02-07 18:03:15 +0100 (So, 07 Feb 2010) | 1 line
Remove unused imports in test modules.
........
|
|
|
|
| |
A patch from Dave Malcolm.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
76286-76287,76289-76294,76296-76299,76301-76305,76307,76310-76311,76313-76322 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76286 | nick.coghlan | 2009-11-15 17:30:34 +1000 (Sun, 15 Nov 2009) | 1 line
Issue #6816: expose the zipfile and directory execution mechanism to Python code via the runpy module. Also consolidated some script execution functionality in the test harness into a helper module and removed some implementation details from the runpy module documentation.
........
r76321 | nick.coghlan | 2009-11-16 13:55:51 +1000 (Mon, 16 Nov 2009) | 1 line
Account for another cache when hunting ref leaks
........
r76322 | nick.coghlan | 2009-11-16 13:57:32 +1000 (Mon, 16 Nov 2009) | 1 line
Allow for backslashes in file paths passed to the regex engine
........
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r69419 | nick.coghlan | 2009-02-08 11:26:34 +1000 (Sun, 08 Feb 2009) | 1 line
Issue 4195: Restore the ability to execute packages with the -m switch (but this time in a way that leaves the import machinery in a valid state). (Original patch by Andi Vajda)
........
r69420 | nick.coghlan | 2009-02-08 11:46:01 +1000 (Sun, 08 Feb 2009) | 1 line
Mention patch submitter in NEWS entry for r69419
........
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r67750 | nick.coghlan | 2008-12-14 20:54:50 +1000 (Sun, 14 Dec 2008) | 1 line
Fix several issues relating to access to source code inside zipfiles. Initial work by Alexander Belopolsky. See Misc/NEWS in this checkin for details.
........
r67751 | nick.coghlan | 2008-12-14 21:09:40 +1000 (Sun, 14 Dec 2008) | 1 line
Add file that was missed from r67750
........
|