homepage

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 arcivanov
Recipients BTaskaya, arcivanov, dino.viehland, pablogsal, vstinner
Date 2020年07月08日.22:11:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594246279.6.0.938698783076.issue41194@roundup.psfhosted.org>
In-reply-to
Content
"Short" reproducer:
repro.py:
```
import sys
from os import getcwd, chdir
from runpy import run_path
def smoke_test(script, *args):
 old_argv = list(sys.argv)
 del sys.argv[:]
 sys.argv.append(script)
 sys.argv.extend(args)
 old_modules = dict(sys.modules)
 old_meta_path = list(sys.meta_path)
 old_cwd = getcwd()
 try:
 return run_path(script, run_name="__main__")
 except SystemExit as e:
 if e.code:
 print("Test did not exit successfully")
 finally:
 del sys.argv[:]
 sys.argv.extend(old_argv)
 sys.modules.clear()
 sys.modules.update(old_modules)
 del sys.meta_path[:]
 sys.meta_path.extend(old_meta_path)
 chdir(old_cwd)
smoke_test("script.py")
smoke_test("script.py")
```
script.py:
```
import sys
import subprocess 
import ast
_PYTHON_INFO_SCRIPT = """import platform, sys, os, sysconfig
_executable = os.path.normcase(os.path.abspath(getattr(sys, "_base_executable", sys.executable)))
_platform = sys.platform
if _platform == "linux2":
 _platform = "linux"
print({
 "_platform": _platform,
 "_os_name": os.name,
 "_executable": (_executable, ),
 "_exec_dir": os.path.normcase(os.path.abspath(os.path.dirname(_executable))),
 "_name": platform.python_implementation(),
 "_type": platform.python_implementation().lower(),
 "_version": tuple(sys.version_info),
 "_is_pypy": "__pypy__" in sys.builtin_module_names,
 "_is_64bit": (getattr(sys, "maxsize", None) or getattr(sys, "maxint")) > 2 ** 32,
 "_versioned_dir_name": "%s-%s" % (platform.python_implementation().lower(), ".".join(str(f) for f in sys.version_info)),
 "_environ": dict(os.environ),
 "_darwin_python_framework": sysconfig.get_config_var("PYTHONFRAMEWORK")
})
"""
result = subprocess.check_output([sys.executable, "-c", _PYTHON_INFO_SCRIPT], universal_newlines=True)
python_info = ast.literal_eval(result)
print(python_info)
```
History
Date User Action Args
2020年07月08日 22:11:19arcivanovsetrecipients: + arcivanov, vstinner, dino.viehland, pablogsal, BTaskaya
2020年07月08日 22:11:19arcivanovsetmessageid: <1594246279.6.0.938698783076.issue41194@roundup.psfhosted.org>
2020年07月08日 22:11:19arcivanovlinkissue41194 messages
2020年07月08日 22:11:19arcivanovcreate

AltStyle によって変換されたページ (->オリジナル) /