Staging
v0.5.1
https://github.com/python/cpython
Revision 96c8475362acb41decd1d7db9243f328973e5de7 authored by Victor Stinner on 26 September 2019, 14:17:34 UTC, committed by GitHub on 26 September 2019, 14:17:34 UTC
* bpo-38234: Py_SetPath() uses the program full path (GH-16357)

Py_SetPath() now sets sys.executable to the program full path
(Py_GetProgramFullPath()), rather than to the program name
(Py_GetProgramName()).

Fix also memory leaks in pathconfig_set_from_config().

(cherry picked from commit 1ce152a42eaa917d7763bce93f1e1ca72530d7ca)

* bpo-38234: Add tests for Python init path config (GH-16358)


(cherry picked from commit bb6bf7d342b4503a6227fd209fac934905b6a1aa)

* bpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366)

Add test_init_pybuilddir() and test_init_pyvenv_cfg() to test_embed
to test pyvenv.cfg and pybuilddir.txt configuration files.

Fix sysconfig._generate_posix_vars(): pybuilddir.txt uses UTF-8
encoding, not ASCII.

(cherry picked from commit 52ad33abbfb6637d74932617c7013bae0ccf6e32)

* bpo-38234: Cleanup getpath.c (GH-16367)

* search_for_prefix() directly calls reduce() if found is greater
  than 0.
* Add calculate_pybuilddir() subfunction.
* search_for_prefix(): add path string buffer for readability.
* Fix some error handling code paths: release resources on error.
* calculate_read_pyenv(): rename tmpbuffer to filename.
* test.pythoninfo now also logs windows.dll_path

(cherry picked from commit 221fd84703c545408bbb4a6e0b58459651331f5c)

* bpo-38234: Fix test_embed pathconfig tests (GH-16390)

bpo-38234: On macOS and FreeBSD, the temporary directory can be
symbolic link. For example, /tmp can be a symbolic link to /var/tmp.
Call realpath() to resolve all symbolic links.

(cherry picked from commit 00508a7407d7d300b487532e2271534b20e378a7)

* bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)

* Add test_embed.test_init_setpath_config(): test Py_SetPath()
  with PyConfig.
* test_init_setpath() and test_init_setpythonhome() no longer call
  Py_SetProgramName(), but use the default program name.
* _PyPathConfig: isolated, site_import  and base_executable
  fields are now only available on Windows.
* If executable is set explicitly in the configuration, ignore
  calculated base_executable: _PyConfig_InitPathConfig() copies
  executable to base_executable.
* Complete path config documentation.

(cherry picked from commit 8bf39b606ef7b02c0279a80789f3c4824b0da5e9)

* bpo-38234: Complete init config documentation (GH-16404)


(cherry picked from commit 88feaecd46a8f427e30ef7ad8cfcddfe392a2402)

* bpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-16406)

Explicitly preinitializes with a Python preconfiguration to avoid
Py_SetPath() implicit preinitialization with a compat
preconfiguration.

Fix also test_init_setpath() and test_init_setpythonhome() on macOS:
use self.test_exe as the executable (and base_executable), rather
than shutil.which('python3').

(cherry picked from commit 49d99f01e6e51acec5ca57a02e857f0796bc418b)

* bpo-38234: Py_Initialize() sets global path configuration (GH-16421)

* Py_InitializeFromConfig() now writes PyConfig path configuration to
  the global path configuration (_Py_path_config).
* Add test_embed.test_get_pathconfig().
* Fix typo in _PyWideStringList_Join().

(cherry picked from commit 12f2f177fc483723406d7917194e7f655a20631b)
1 parent 68040ed
History
Tip revision: 96c8475362acb41decd1d7db9243f328973e5de7 authored by Victor Stinner on 26 September 2019, 14:17:34 UTC
[3.8] bpo-38234: Backport init path config changes from master (GH-16423)
Tip revision: 96c8475
File Mode Size
_blake2
_ctypes
_decimal
_io
_multiprocessing
_sha3
_sqlite
_ssl
_xxtestfuzz
cjkcodecs
clinic
expat
README -rw-r--r-- 112 bytes
Setup -rw-r--r-- 14.4 KB
_abc.c -rw-r--r-- 21.8 KB
_asynciomodule.c -rw-r--r-- 85.6 KB
_bisectmodule.c -rw-r--r-- 8.0 KB
_bz2module.c -rw-r--r-- 23.8 KB
_codecsmodule.c -rw-r--r-- 32.3 KB
_collectionsmodule.c -rw-r--r-- 78.4 KB
_contextvarsmodule.c -rw-r--r-- 1.9 KB
_cryptmodule.c -rw-r--r-- 1.5 KB
_csv.c -rw-r--r-- 49.6 KB
_curses_panel.c -rw-r--r-- 17.1 KB
_cursesmodule.c -rw-r--r-- 126.7 KB
_datetimemodule.c -rw-r--r-- 214.5 KB
_dbmmodule.c -rw-r--r-- 13.8 KB
_elementtree.c -rw-r--r-- 125.5 KB
_functoolsmodule.c -rw-r--r-- 43.4 KB
_gdbmmodule.c -rw-r--r-- 19.4 KB
_hashopenssl.c -rw-r--r-- 28.5 KB
_heapqmodule.c -rw-r--r-- 21.5 KB
_json.c -rw-r--r-- 60.3 KB
_localemodule.c -rw-r--r-- 19.3 KB
_lsprof.c -rw-r--r-- 25.8 KB
_lzmamodule.c -rw-r--r-- 46.8 KB
_math.c -rw-r--r-- 7.3 KB
_math.h -rw-r--r-- 1007 bytes
_opcode.c -rw-r--r-- 2.1 KB
_operator.c -rw-r--r-- 48.6 KB
_pickle.c -rw-r--r-- 228.2 KB
_posixsubprocess.c -rw-r--r-- 26.5 KB
_queuemodule.c -rw-r--r-- 11.9 KB
_randommodule.c -rw-r--r-- 17.7 KB
_scproxy.c -rw-r--r-- 6.0 KB
_sre.c -rw-r--r-- 75.9 KB
_ssl.c -rw-r--r-- 188.6 KB
_ssl_data.h -rw-r--r-- 67.9 KB
_stat.c -rw-r--r-- 15.8 KB
_statisticsmodule.c -rw-r--r-- 4.8 KB
_struct.c -rw-r--r-- 65.0 KB
_testbuffer.c -rw-r--r-- 82.2 KB
_testcapimodule.c -rw-r--r-- 182.7 KB
_testimportmultiple.c -rw-r--r-- 1.1 KB
_testinternalcapi.c -rw-r--r-- 819 bytes
_testmultiphase.c -rw-r--r-- 17.7 KB
_threadmodule.c -rw-r--r-- 48.6 KB
_tkinter.c -rw-r--r-- 91.2 KB
_tracemalloc.c -rw-r--r-- 43.4 KB
_uuidmodule.c -rw-r--r-- 1.8 KB
_weakref.c -rw-r--r-- 4.5 KB
_winapi.c -rw-r--r-- 59.3 KB
_xxsubinterpretersmodule.c -rw-r--r-- 64.9 KB
addrinfo.h -rw-r--r-- 5.9 KB
arraymodule.c -rw-r--r-- 88.1 KB
atexitmodule.c -rw-r--r-- 8.9 KB
audioop.c -rw-r--r-- 57.2 KB
binascii.c -rw-r--r-- 53.8 KB
cmathmodule.c -rw-r--r-- 42.3 KB
config.c.in -rw-r--r-- 1.6 KB
errnomodule.c -rw-r--r-- 28.1 KB
faulthandler.c -rw-r--r-- 38.9 KB
fcntlmodule.c -rw-r--r-- 19.9 KB
gc_weakref.txt -rw-r--r-- 11.2 KB
gcmodule.c -rw-r--r-- 63.4 KB
getaddrinfo.c -rw-r--r-- 18.4 KB
getbuildinfo.c -rw-r--r-- 1.3 KB
getnameinfo.c -rw-r--r-- 6.2 KB
getpath.c -rw-r--r-- 40.5 KB
grpmodule.c -rw-r--r-- 8.3 KB
hashlib.h -rw-r--r-- 2.1 KB
hashtable.c -rw-r--r-- 14.1 KB
hashtable.h -rw-r--r-- 6.2 KB
itertoolsmodule.c -rw-r--r-- 148.4 KB
ld_so_aix.in -rw-r--r-- 6.1 KB
main.c -rw-r--r-- 17.2 KB
makesetup -rwxr-xr-x 7.7 KB
makexp_aix -rwxr-xr-x 3.2 KB
mathmodule.c -rw-r--r-- 98.8 KB
md5module.c -rw-r--r-- 15.0 KB
mmapmodule.c -rw-r--r-- 46.7 KB
nismodule.c -rw-r--r-- 11.7 KB
ossaudiodev.c -rw-r--r-- 36.1 KB
overlapped.c -rw-r--r-- 51.7 KB
parsermodule.c -rw-r--r-- 40.5 KB
posixmodule.c -rw-r--r-- 378.2 KB
posixmodule.h -rw-r--r-- 837 bytes
pwdmodule.c -rw-r--r-- 8.1 KB
pyexpat.c -rw-r--r-- 57.3 KB
readline.c -rw-r--r-- 37.3 KB
resource.c -rw-r--r-- 12.4 KB
rotatingtree.c -rw-r--r-- 3.4 KB
rotatingtree.h -rw-r--r-- 924 bytes
selectmodule.c -rw-r--r-- 76.7 KB
sha1module.c -rw-r--r-- 14.1 KB
sha256module.c -rw-r--r-- 22.2 KB
sha512module.c -rw-r--r-- 27.5 KB
signalmodule.c -rw-r--r-- 44.9 KB
socketmodule.c -rw-r--r-- 240.2 KB
socketmodule.h -rw-r--r-- 7.3 KB
spwdmodule.c -rw-r--r-- 5.9 KB
sre.h -rw-r--r-- 2.8 KB
sre_constants.h -rw-r--r-- 2.8 KB
sre_lib.h -rw-r--r-- 52.2 KB
symtablemodule.c -rw-r--r-- 3.2 KB
syslogmodule.c -rw-r--r-- 9.4 KB
termios.c -rw-r--r-- 20.4 KB
testcapi_long.h -rw-r--r-- 6.8 KB
timemodule.c -rw-r--r-- 51.8 KB
tkappinit.c -rw-r--r-- 4.7 KB
tkinter.h -rw-r--r-- 881 bytes
unicodedata.c -rw-r--r-- 43.8 KB
unicodedata_db.h -rw-r--r-- 524.3 KB
unicodename_db.h -rw-r--r-- 2.1 MB
winreparse.h -rw-r--r-- 1.6 KB
xxlimited.c -rw-r--r-- 7.0 KB
xxmodule.c -rw-r--r-- 12.6 KB
xxsubtype.c -rw-r--r-- 10.8 KB
zlibmodule.c -rw-r--r-- 41.6 KB

README

back to top