Commit Graph

1357 Commits

Author SHA1 Message Date
Miss Islington (bot) 4f54ca0734
bpo-42120: Remove macro defining copysign to _copysign on Windows (GH-23326)
(cherry picked from commit 9cc9e27725)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-11-16 15:42:49 -08:00
Miss Skeleton (bot) 333782a3f4
bpo-38439: Update the Windows Store package's icons for IDLE. Artwork by Andrew Clover (GH-22817)
(cherry picked from commit 6d883fbe14)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-10-20 10:17:17 -07:00
Miss Islington (bot) bbab34084e
bpo-41729: Fix test_winconsole failures (3) and hang (GH-22146)
The problems occured with a repository build on machine
with freshly updated Windows 10 Pro.
(cherry picked from commit 31c9828ec0)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-09-11 23:09:08 -07:00
Miss Islington (bot) 3b6a8d2455
bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495)
(cherry picked from commit 936a660945)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-15 15:15:37 -07:00
Miss Islington (bot) aa7f775614
bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) (GH-21352)
Also enables using debug build of `python3_d.dll`
Reference: CVE-2020-15523
(cherry picked from commit dcbaa1b49c)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-06 19:12:16 +02:00
Miss Islington (bot) 3f4de44cf7
bpo-41074: Fix support of non-ASCII names and SQL in msilib. (GH-21126)
* Fix support of non-ASCII names in functions OpenDatabase()
  and init_database().
* Fix support of non-ASCII SQL in method Database.OpenView().
(cherry picked from commit 55939b1708)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-25 02:12:41 -07:00
Miss Islington (bot) fb4a624105
bpo-41038: Fix non-ASCII string corruption in Win32 resource files (GH-20985)
In absence of explicit declaration, resource compiler uses system
codepage. When this codepage is DBCS or UTF-8, Python's copyright
string is corrupted, because it contains copyright sign encoded
as \xA9.

The fix is to explicitly declare codepage 1252.
(cherry picked from commit 33b79b11b8)

Co-authored-by: Nikita Nemkin <nikita@nemkin.ru>
2020-06-24 09:42:55 -07:00
Miss Islington (bot) 460eac20a6
bpo-35890: Use RegQueryInfoKeyW and CryptAcquireContextW explicitly (GH-19974)
(cherry picked from commit 98e42d1f88)

Co-authored-by: Minmin Gong <gongminmin@msn.com>
2020-05-18 10:09:59 -07:00
Miss Islington (bot) e6685ad053
bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343)
Fix default Python home path relative to the NuGet package
(cherry picked from commit 6e623ff9d2)

Co-authored-by: Chris Martinez <sydefekt@hotmail.com>
2020-04-03 23:20:12 +01:00
Miss Islington (bot) 17571c54e0
bpo-39930: Convert error to warning for more silent failure (GH-18921)
Makes it an error to create a layout without vcruntime DLL
(cherry picked from commit fde44ae6d0)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-11 07:31:07 -07:00
Stefan Krah 4d7012410c
[3.8] bpo-39794: Add --without-decimal-contextvar (GH-18702)
(cherry picked from commit 815280eb16)
2020-02-29 22:16:32 +01:00
Miss Islington (bot) 45c4112b72
bpo-39789: Update Windows release build machines to VS 2019 (GH-18695)
Also fixes some potential Nuget build issues.
(cherry picked from commit 03153dd145)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-02-28 16:41:03 -08:00
Miss Islington (bot) 1bbb81b251
bpo-38403: Update nuspec file for deprecated field and git repository (GH-18657)
(cherry picked from commit d644891970)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-02-25 12:24:48 -08:00
Miss Islington (bot) d0a464e31a
bpo-39184: Fix incorrect return value (GH-18580)
https://bugs.python.org/issue39184

Automerge-Triggered-By: @zooba
(cherry picked from commit 6c444d0dab)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-02-20 14:44:47 -08:00
Steve Dower a00b5be5f7
bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407)
Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2020-02-13 08:30:27 +00:00
Steve Dower ad4a20b87d
[3.8] bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231) (GH-18234)
https://bugs.python.org/issue39401



Automerge-Triggered-By: @zooba
2020-01-29 22:18:25 -08:00
Miss Islington (bot) 00e2fe4f21
bpo-39012: Fix RC version suffix for nuget release files (GH-17564)
(cherry picked from commit d0802d07d2)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-12-10 15:40:02 -08:00
Miss Islington (bot) 0ac9aaeb97
bpo-39007: Add auditing events to functions in winreg (GH-17541)
Also allows winreg.CloseKey() to accept same types as other functions.
(cherry picked from commit ee17e37356)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-12-09 11:36:25 -08:00
Miss Islington (bot) c5a2a974d3
Fix APPX registry key generation (GH-17489)
(cherry picked from commit e89e159b18)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-12-09 09:02:22 -08:00
Steve Dower c9f480d2cc
bpo-33125: Add support for building and releasing Windows ARM64 packages (GH-17480)
Note that the support is not actually enabled yet, and so we won't be publishing these packages. However, for those who want to build it themselves (even by reusing the Azure Pipelines definition), it's now relatively easy to enable.
2019-12-06 09:40:39 -08:00
Miss Skeleton (bot) 07eee640cb
bpo-38519: Internal include files missing on Windows (GH-16921)
(cherry picked from commit edb172a872)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-10-28 10:23:07 -07:00
Miss Islington (bot) e74fa70bcc
bpo-38359: Ensures pyw.exe launcher reads correct registry key (GH-16561)
(cherry picked from commit 353fb1ecbf)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-03 08:51:12 -07:00
Miss Islington (bot) a11df75269
bpo-38343: Fixes version handling for nuget packages (GH-16527)
(cherry picked from commit b9a8b8296c)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-01 17:00:49 -07:00
Miss Islington (bot) d49f096cc4
bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)
PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
longer return PyStatus: they cannot fail anymore.
(cherry picked from commit 8462a4936b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-10-01 03:26:04 -07:00
Victor Stinner bdace21b76 bpo-38304: Remove PyConfig.struct_size (GH-16500)
For now, we'll rely on the fact that the config structures aren't covered by the stable ABI.

We may revisit this in the future if we further explore the idea of offering a stable embedding API.
2019-10-01 08:46:42 +10:00
Victor Stinner 18c4ba9f33
bpo-38322: Fix gotlandmark() of PC/getpathp.c (GH-16490)
Write the filename into a temporary buffer instead of reusing prefix.
The problem is that join() modifies prefix inplace. If prefix is not
normalized, join() can make prefix shorter and so gotlandmark()
does modify prefix instead of returning it unmodified.
2019-09-30 14:49:42 +02:00
Victor Stinner 81f6b031c4
bpo-38304: Fix PyConfig usage in python_uwp.cpp (GH-16488)
* Set PyPreConfig.struct_size and PyConfig.struct_size as required by
  the API.
* PyPreConfig_InitPythonConfig() can now fail: check PyStatus result.
2019-09-30 12:53:17 +02:00
Victor Stinner 96c8475362
[3.8] bpo-38234: Backport init path config changes from master (GH-16423)
* 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 1ce152a42e)

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


(cherry picked from commit bb6bf7d342)

* 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 52ad33abbf)

* 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 221fd84703)

* 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 00508a7407)

* 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 8bf39b606e)

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


(cherry picked from commit 88feaecd46)

* 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 49d99f01e6)

* 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 12f2f177fc)
2019-09-26 16:17:34 +02:00
Miss Islington (bot) 7f7cd899e3
bpo-38234: read_pth_file() now returns PyStatus (GH-16338)
Refactor path configuration code:

* read_pth_file() now returns PyStatus to report errors, rather than
  calling Py_FatalError().
* Move argv0_path and zip_path buffers out of PyCalculatePath
  structures.
* On Windows, _PyPathConfig.home is now preferred over PyConfig.home.
(cherry picked from commit 85ce0a7178)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-23 16:16:53 -07:00
Victor Stinner 3f5409a3f1
bpo-38234: Fix _PyConfig_InitPathConfig() (GH-16335) (GH-16336)
* _PyConfig_InitPathConfig() now starts by copying the global path
  configuration, and then override values set in PyConfig.
* _PyPathConfig_Calculate() implementations no longer override
  _PyPathConfig fields which are already computed. For example,
  if _PyPathConfig.prefix is not NULL, leave it unchanged.
* If Py_SetPath() has been called, _PyConfig_InitPathConfig() doesn't
  call _PyPathConfig_Calculate() anymore.
* _PyPathConfig_Calculate() no longer uses PyConfig,
  except to initialize PyCalculatePath structure.
* pathconfig_calculate(): remove useless temporary
  "_PyPathConfig new_config" variable.
* calculate_module_search_path(): remove hack to workaround memory
  allocation failure, call Py_FatalError() instead.
* Fix get_program_full_path(): handle memory allocation failure.

(cherry picked from commit 9c42f8cda5)
2019-09-23 19:50:27 +02:00
Victor Stinner c5c642565e
bpo-38236: Dump path config at first import error (GH-16300) (GH-16332)
Python now dumps path configuration if it fails to import the Python
codecs of the filesystem and stdio encodings.

(cherry picked from commit fcdb027234)
2019-09-23 15:59:00 +02:00
Victor Stinner 9f3dcf802e
[3.8] bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298) (GH-16313)
* bpo-38234: Remove _PyPathConfig.dll_path (GH-16307)

The DLL path is not computed from any user configuration and cannot
be configured by PyConfig. Instead, add a new _Py_dll_path global variable.

Remove _PyConfig_SetPathConfig(): replaced with _PyPathConfig_Init().

Py_Initialize() now longer sets the "global path configuration",
but only initialize _Py_dll_path.

(cherry picked from commit c422167749)

* bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298)

* If Py_SetPath() has been called, _PyConfig_InitPathConfig() now
  uses its value.
* Py_Initialize() now longer copies path configuration from PyConfig
  to the global path configuration (_Py_path_config).

(cherry picked from commit e267793aa4)
2019-09-21 02:13:14 +02:00
Miss Islington (bot) 664d56a52e
bpo-38133: Allow py.exe launcher to locate installations from the Microsoft Store (GH-16025)
(cherry picked from commit ed93a8852d)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-12 10:36:14 -07:00
Miss Islington (bot) 436cd2c20b
bpo-38114: Do not include pip.ini in Nuget package (GH-15964)
(cherry picked from commit 19f6940cd7)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-11 08:57:54 -07:00
Miss Islington (bot) 44729c9f51
bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)
(cherry picked from commit ef66f31ce2)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-09 07:23:37 -07:00
Miss Islington (bot) 68e401fa0b
bpo-37705: Improve the implementation of winerror_to_errno() (GH-15623)
winerror_to_errno() is no longer automatically generated.
Do not rely on the old _dosmapperr() function.
Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
(cherry picked from commit 19052a1131)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 03:37:55 -07:00
Miss Islington (bot) ebca7eb093
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (GH-13239)
* bpo-32587: Make winreg.REG_MULTI_SZ support PendingFileRenameOperations

* Address review comments.
(cherry picked from commit e223ba13d8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 03:11:00 -07:00
Miss Islington (bot) e103732f5d
bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls (GH-14462)
If FormatMessageW() is passed the FORMAT_MESSAGE_FROM_SYSTEM flag without FORMAT_MESSAGE_IGNORE_INSERTS, it will fail if there are insert sequences in the message definition.
(cherry picked from commit a6563650c8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 02:50:30 -07:00
Serhiy Storchaka 96631dcb11
[3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599)
(cherry picked from commit 4901fe274b)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-08-29 18:29:59 +03:00
Nick Coghlan 6ca030765d
[3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15491)
- drop TargetScopeError in favour of raising SyntaxError directly
  as per the updated PEP 572
- comprehension iteration variables are explicitly local, but
  named expression targets in comprehensions are nonlocal or
  global. Raise SyntaxError as specified in PEP 572
- named expression targets in the outermost iterable of a
  comprehension have an ambiguous target scope. Avoid resolving
  that question now by raising SyntaxError. PEP 572
  originally required this only for cases where the bound name
  conflicts with the iteration variable in the comprehension,
  but CPython can't easily restrict the exception to that case
  (as it doesn't know the target variable names when visiting
  the outermost iterator expression)

(cherry picked from commit 5dbe0f59b7)
2019-08-26 00:41:47 +10:00
Serhiy Storchaka ed146b52a3
[3.8] bpo-37830: Fix compilation of break and continue in finally. (GH-15320) (GH-15456)
Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value.
(cherry picked from commit ef61c524dd)
2019-08-24 13:41:53 +03:00
Miss Islington (bot) 5779c53632 bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266) (GH-15441)
(cherry picked from commit 0a18ee4be7)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-08-23 15:39:27 -07:00
Miss Islington (bot) 2878f378e0
bpo-27961: Remove leftovers from the times when long long wasn't required (GH-15388)
(cherry picked from commit a38e9d1399)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2019-08-22 08:59:18 -07:00
Miss Islington (bot) a150feeeb8
Remove versioned executables from non-APPX packages (GH-15237)
(cherry picked from commit c1aeb292d2)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-08-12 15:16:36 -07:00
Miss Islington (bot) 84d31bbf1f
bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)
(cherry picked from commit 0378d98678)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-08-07 11:59:09 -07:00
Miss Islington (bot) dc6653fd06
bpo-37778: Fixes the icons used for file associations to the Microsoft Store package (GH-15150)
(cherry picked from commit 87ce9588ce)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-08-07 11:15:15 -07:00
Miss Islington (bot) eab76c3c75
bpo-37734: Fix use of registry values to launch Python from Microsoft Store app (GH-15146)
(cherry picked from commit 1fab9cbfba)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-08-07 11:07:43 -07:00
Miss Islington (bot) dd5f8abb54
bpo-37730: Fix usage of NotImplemented instead of NotImplementedError in docs. (GH-15062)
(cherry picked from commit ed5e8e06cb)

Co-authored-by: David H <dheiberg@mozilla.com>
2019-08-04 06:43:30 -07:00
Miss Islington (bot) 0f211979c2
bpo-37641 preserve relative file location in embeddable zip (GH-14884)
Previously, pyc files in the embeddable distribution reported their
location as <build path>/<file stem>.py. This causes a little confusion
when interpreting stack traces as the file is in a (almost certainly)
incorrect location, and lacks the full relative path to Lib (e.g.
email/mime/image.py will only show image.py).

This change preserves the Lib relative location of the source file as a
path so that stack traces are (hopefully) less misleading and more
informative.

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit c4cda4369f)

Co-authored-by: Bill Collins <bilbocollins@gmail.com>
2019-07-25 14:55:43 -07:00
Miss Islington (bot) 4b7ce105ff
bpo-37672: Switch Windows Store package to use pip.ini for user mode (GH-14939)
(cherry picked from commit 123536fdab)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-07-24 15:31:48 -07:00