Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: python/cpython
Choose a Base Repository
python/cpython
1st1/cpython
Acidburn0zzz/cpython
AlvinRenNo1/cpython
Andreasyin/cpython
ApproximateIdentity/cpython
AraHaan/cpython
Atishay990/cpython
CLANNADHH/cpython
CNXTEoEorg/cpython-1
ChyiYaqing/cpython
CuriousLearner/cpython
DaFeii/cpython
DalavanCloud/cpython
DarkmaneTheRobot/cpython
EpicWink/cpython
ErikHendriks/cpython
Frankenstein1836/cpython
FrostyFeng/cpython
HeidiWindkraft/strict_cpython
JN646/cpython
JacksonKearl/cpython
Jesse-Bakker/cpython
Kamos86/cpython
KanesAccount/cpython
KrzysztofSzewczyk/Zaskroniec
LALINUX2019/cpython
LenochkaNSK18/cpython
Li-Michael/cpython
Longinushadow/cpython
MuhammadZubair210/cpython
Munyola/cpython
Neo23x0/cpython
NoahGWood/cpython
OnePPCDev/cpython
OpenGemini/cpython
PadmajaVB/cpython
PatrickRudgeri/cpython
PraveenChaudhary/cpython
Radu-Raicea/cpython
RekGRpth/cpython
Rosuav/cpython
Seluj78/cpython
Silver-Taurus/cpython
SimiCode/cpython
SystemicCypher/cpython
Uberi/cpython
VIP21/cpython
VisualMemory/cpython
VonBluebaugh/cpython
Wind-River/cpython
Xhollo/cpython
XiongQiuQiu/cpython
XuZhongCN/cpython
ZhangYunfang/cpython
aclements/cpython
agoose77/cpython
ahcub/cpython
airboat/cpython
aixtools/cpython
amey589/cpython
andrekorol/cpython
animenon/cpython
arantebw/cpython
babara34r/cpython
badrkamel/cpython
berkerpeksag/cpython
bharel/cpython
bmeck/cpython
bmoffatt/cpython
borisuvarov/cpython
bytebuild/cpython
cagney/cpython
cannibal-4852/cpython
cccl/cpython
christopherkang/cpython
codeanynote/cpython
contail/cpython
damngamerz/cpython
delimitry/cpython
delivrance/cpython
deltaIncrement/cpython
devesh-verma/cpython
dhimmel/cpython
dilenondelfino/cpython
dk1978/cpython
dsoprea/cpython
dstanek/cpython
ethanhs/cpython
fishing161/cpython
fonsp/cpython
fpnp/cpython
frankmadao/cpython
freakboy3742/cpython
freddrake/andresdelfino-cpython
fredrikaverpil/cpython
gowtham5699/cpython
greatspider135/cpython
gvanrossum/cpython
hackfengJam/cpython
hkkhuang/cpython
hongweipeng/cpython
imzhong/cpython
jackass0528/cpython
jansure/cpython
jaraco/cpython
jdemeyer/cpython
jishanshaikh4/cpython
jmzanker/cpython
jnwlkr/cpython
jonejiang/cpython
kadler/cpython
khanhqthai/cpython
koreindian/cpython
kovidgoyal/cpython
kripken/cpython
kuhlenough/cpython-for-VxWorks
kushaldas/cpython
kw-andy/cpython
longshifeng/cpython
luojun001/cpython
luoshuxiao/cpython
marcosmagno/cpython
markshannon/cpython
miss-islington/cpython
mkiever/cpython
ml451953014/cpython
mohisen/cpython
nanjekyejoannah/cpython
nhuduy/cpython
niubanjin/cpython
oconnor663/cpython
oranav/cpython
pablogsal/cpython
passengeryjy/cpython
pedrorhian944/cpython
podshumok/cpython
pomidoroshev/cpython
pxinwr/cpython
pynickle/cpython
pythoncapi/cpython
ratnania/cpython
refoo/cpython
remitamine/cpython
rhettinger/cpython
rkialashaki/cpython
rohitsr24/cpython
rxy007/cpython
samuelcolvin/cpython
scharron/cpython
schedutron/cpython
seanharr11/cpython
sebospc/cpython
serhiy-storchaka/cpython
shabnam99/cpython
shangzhipei/cpython
sheldonzeng/cpython
shlomif/cpython
sisuad/cpython
snjypl/cpython
stackless-dev/stackless
sthagen/cpython
subhashissuara/cpython
sudonitesh/cpython
supitchayapat/cpython
swizl/cnpython
taborda11/cpython
thomascherickal/cpython
tiangolo/cpython
tim-one/cpython
toloveru/cpython
tonybaloney/cpython
tonydapiza/cpython
tovrstra/cpython
trenchmortar/cpython
tripmani/cpython
trishnaguha/cpython
tvikneshwar/cpython
tzickel/cpython
ukbaranwal/cpython
ukysung/cpython
unscientific/cpython
val314159/cpython
veltata/cpython
vlad-tokarev/cpython
vmsp/cpython
vsajip/cpython
vstinner/cpython
worldhema/cpython
wylllorenz/cpython
xmanrui/cpython
yewsGitHub/cpython
yuc8939/cpython
yutiansut/cpython
yyang42/cpython
zhang-hong-yang/cpython
zhangch9/cpython
zhangyangyu/cpython
zooba/cpython
zsxmatthew/cpython
Nothing to show
base: master
head repository: python/cpython
Choose a Head Repository
python/cpython
1st1/cpython
Acidburn0zzz/cpython
AlvinRenNo1/cpython
Andreasyin/cpython
ApproximateIdentity/cpython
AraHaan/cpython
Atishay990/cpython
CLANNADHH/cpython
CNXTEoEorg/cpython-1
ChyiYaqing/cpython
CuriousLearner/cpython
DaFeii/cpython
DalavanCloud/cpython
DarkmaneTheRobot/cpython
EpicWink/cpython
ErikHendriks/cpython
Frankenstein1836/cpython
FrostyFeng/cpython
HeidiWindkraft/strict_cpython
JN646/cpython
JacksonKearl/cpython
Jesse-Bakker/cpython
Kamos86/cpython
KanesAccount/cpython
KrzysztofSzewczyk/Zaskroniec
LALINUX2019/cpython
LenochkaNSK18/cpython
Li-Michael/cpython
Longinushadow/cpython
MuhammadZubair210/cpython
Munyola/cpython
Neo23x0/cpython
NoahGWood/cpython
OnePPCDev/cpython
OpenGemini/cpython
PadmajaVB/cpython
PatrickRudgeri/cpython
PraveenChaudhary/cpython
Radu-Raicea/cpython
RekGRpth/cpython
Rosuav/cpython
Seluj78/cpython
Silver-Taurus/cpython
SimiCode/cpython
SystemicCypher/cpython
Uberi/cpython
VIP21/cpython
VisualMemory/cpython
VonBluebaugh/cpython
Wind-River/cpython
Xhollo/cpython
XiongQiuQiu/cpython
XuZhongCN/cpython
ZhangYunfang/cpython
aclements/cpython
agoose77/cpython
ahcub/cpython
airboat/cpython
aixtools/cpython
amey589/cpython
andrekorol/cpython
animenon/cpython
arantebw/cpython
babara34r/cpython
badrkamel/cpython
berkerpeksag/cpython
bharel/cpython
bmeck/cpython
bmoffatt/cpython
borisuvarov/cpython
bytebuild/cpython
cagney/cpython
cannibal-4852/cpython
cccl/cpython
christopherkang/cpython
codeanynote/cpython
contail/cpython
damngamerz/cpython
delimitry/cpython
delivrance/cpython
deltaIncrement/cpython
devesh-verma/cpython
dhimmel/cpython
dilenondelfino/cpython
dk1978/cpython
dsoprea/cpython
dstanek/cpython
ethanhs/cpython
fishing161/cpython
fonsp/cpython
fpnp/cpython
frankmadao/cpython
freakboy3742/cpython
freddrake/andresdelfino-cpython
fredrikaverpil/cpython
gowtham5699/cpython
greatspider135/cpython
gvanrossum/cpython
hackfengJam/cpython
hkkhuang/cpython
hongweipeng/cpython
imzhong/cpython
jackass0528/cpython
jansure/cpython
jaraco/cpython
jdemeyer/cpython
jishanshaikh4/cpython
jmzanker/cpython
jnwlkr/cpython
jonejiang/cpython
kadler/cpython
khanhqthai/cpython
koreindian/cpython
kovidgoyal/cpython
kripken/cpython
kuhlenough/cpython-for-VxWorks
kushaldas/cpython
kw-andy/cpython
longshifeng/cpython
luojun001/cpython
luoshuxiao/cpython
marcosmagno/cpython
markshannon/cpython
miss-islington/cpython
mkiever/cpython
ml451953014/cpython
mohisen/cpython
nanjekyejoannah/cpython
nhuduy/cpython
niubanjin/cpython
oconnor663/cpython
oranav/cpython
pablogsal/cpython
passengeryjy/cpython
pedrorhian944/cpython
podshumok/cpython
pomidoroshev/cpython
pxinwr/cpython
pynickle/cpython
pythoncapi/cpython
ratnania/cpython
refoo/cpython
remitamine/cpython
rhettinger/cpython
rkialashaki/cpython
rohitsr24/cpython
rxy007/cpython
samuelcolvin/cpython
scharron/cpython
schedutron/cpython
seanharr11/cpython
sebospc/cpython
serhiy-storchaka/cpython
shabnam99/cpython
shangzhipei/cpython
sheldonzeng/cpython
shlomif/cpython
sisuad/cpython
snjypl/cpython
stackless-dev/stackless
sthagen/cpython
subhashissuara/cpython
sudonitesh/cpython
supitchayapat/cpython
swizl/cnpython
taborda11/cpython
thomascherickal/cpython
tiangolo/cpython
tim-one/cpython
toloveru/cpython
tonybaloney/cpython
tonydapiza/cpython
tovrstra/cpython
trenchmortar/cpython
tripmani/cpython
trishnaguha/cpython
tvikneshwar/cpython
tzickel/cpython
ukbaranwal/cpython
ukysung/cpython
unscientific/cpython
val314159/cpython
veltata/cpython
vlad-tokarev/cpython
vmsp/cpython
vsajip/cpython
vstinner/cpython
worldhema/cpython
wylllorenz/cpython
xmanrui/cpython
yewsGitHub/cpython
yuc8939/cpython
yutiansut/cpython
yyang42/cpython
zhang-hong-yang/cpython
zhangch9/cpython
zhangyangyu/cpython
zooba/cpython
zsxmatthew/cpython
Nothing to show
compare: 3.8
Checking mergeability… Don’t worry, you can still create the pull request.
This comparison is big! We’re only showing the most recent 250 commits
Commits on Oct 01, 2019
This is a revert of the revert (GH-15826).  Having a tp_clear for
functions should be safe (and helpful) now that bpo-38006 has been
fixed.
…size (GH-16491) (#16506)

(cherry picked from commit 94e1650)

Co-authored-by: Giampaolo Rodola <g.rodola@gmail.com>
PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
longer return PyStatus: they cannot fail anymore.
(cherry picked from commit 8462a49)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
* Windows: Fix counter name in WindowsLoadTracker. Counter names are
  localized: use the registry to get the counter name. Original
  change written by Lorenz Mende.
* Regrtest.main() now ensures that the Windows load tracker is also
  killed if an exception is raised
* TestWorkerProcess now ensures that worker processes are no longer
  running before exiting: kill also worker processes when an
  exception is raised.
* Enhance regrtest messages and warnings: include test name,
  duration, add a worker identifier, etc.
* Rename MultiprocessRunner to TestWorkerProcess
* Use print_warning() to display warnings.

Co-Authored-By: Lorenz Mende <Lorenz.mende@gmail.com>
(cherry picked from commit 982bfa4)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-38321: Fix _asynciomodule.c compiler warning (GH-16493)

bpo-38248, bpo-38321: Fix warning:

    modules\_asynciomodule.c(2667):
    warning C4102: 'set_exception': unreferenced label

The related goto has been removed by
commit edad4d8.

(cherry picked from commit efe74b6)

* bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492)

bpo-22273, bpo-38321: Fix following warning:

    modules\_ctypes\stgdict.c(704):
    warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data

(cherry picked from commit c9a413e)
(cherry picked from commit 891e9e3)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
Commits on Oct 02, 2019
(cherry picked from commit b9a8b82)

Co-authored-by: Steve Dower <steve.dower@python.org>
* Fix TestWorkerProcess.__repr__(): start_time is only valid
  if _popen is not None.
* Fix _kill(): don't set _killed to True if _popen is None.
* _run_process(): only set _killed to False after calling
  run_test_in_subprocess().
(cherry picked from commit 2ea71a0)

Co-authored-by: Victor Stinner <vstinner@python.org>
test.pythoninfo now logs environment variables used by OpenSSL and
Python ssl modules, and logs attributes of 3 SSL contexts
(SSLContext, default HTTPS context, stdlib context).
(cherry picked from commit b3e7045)

Co-authored-by: Victor Stinner <vstinner@python.org>
Commits on Oct 03, 2019
…H-16550) (GH-16560)

* bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550)

WindowsLoadTracker.read_output() now uses a short buffer for
incomplete line.

(cherry picked from commit 3e04cd2)

* bpo-36670: Enhance regrtest WindowsLoadTracker (GH-16553)

The last line is now passed to the parser even if it does not end
with a newline, but only if it's a valid value.

(cherry picked from commit c65119d)

* bpo-36670: Enhance regrtest (GH-16556)

* Add log() method: add timestamp and load average prefixes
  to main messages.
* WindowsLoadTracker:

  * LOAD_FACTOR_1 is now computed using SAMPLING_INTERVAL
  * Initialize the load to the arithmetic mean of the first 5 values
    of the Processor Queue Length value (so over 5 seconds), rather
    than 0.0.
  * Handle BrokenPipeError and when typeperf exit.

* format_duration(1.5) now returns '1.5 sec', rather than
  '1 sec 500 ms'

(cherry picked from commit 098e256)
(cherry picked from commit a0e3d27)

Co-authored-by: Steve Dower <steve.dower@python.org>
)

(cherry picked from commit 353fb1e)

Co-authored-by: Steve Dower <steve.dower@python.org>
)

(cherry picked from commit b23a842)

Co-authored-by: idomic <michael.ido@gmail.com>
Commits on Oct 04, 2019
…16571) (GH-16576)

(cherry picked from commit 3142c66)

Co-authored-by: Ashley Whetter <AWhetter@users.noreply.github.com>
…cl. (GH-16545)

On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the
"surrogatepass" error handler for converting to/from Tcl Unicode objects.

On Linux use UTF-8 with the "surrogateescape" error handler for converting
to/from Tcl String objects.

Converting strings from Tcl to Python and back now never fails
(except MemoryError).
(cherry picked from commit 06cb94b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Commits on Oct 06, 2019
… bytearray. (GH-16603)

(cherry picked from commit 24ddd9c)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
Commits on Oct 07, 2019
…16588)

The `required` argument to `argparse.add_subparsers` was added in GH-3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok
(cherry picked from commit 9e71917)

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
(cherry picked from commit 038503e)

Co-authored-by: Krishna Oza <krishoza15sep@gmail.com>
(cherry picked from commit 321def8)

Co-authored-by: Ben Harper <btharper1221@gmail.com>
Always define _PyUnicode_CheckConsistency() in the CPython C API.
…tion. (GH-16442)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d)

Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
(cherry picked from commit e310af9)

Co-authored-by: James Abel <j@abel.co>
Commits on Oct 08, 2019
(cherry picked from commit 5dfbb4d)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
…o stderr. (GH-16583)

It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.
(cherry picked from commit b690a27)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Valgrind emits "Conditional jump or move depends on uninitialised
value(s)" false alarms on GCC builtin strcmp() function. The GCC code
is correct.

Valgrind bug: https://bugs.kde.org/show_bug.cgi?id=264936
(cherry picked from commit 03ab6b4)

Co-authored-by: Victor Stinner <vstinner@python.org>
…H-16641)

(cherry picked from commit 13abda4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 8252c52)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…H-16662)

The implementation of weakref.proxy's methods call back into the Python
API using a borrowed references of the weakly referenced object
(acquired via PyWeakref_GET_OBJECT). This API call may delete the last
reference to the object (either directly or via GC), leaving a dangling
pointer, which can be subsequently dereferenced.

To fix this, claim a temporary ownership of the referenced object when
calling the appropriate method. Some functions because at the moment they
do not need to access the borrowed referent, but to protect against
future changes to these functions, ownership need to be fixed in
all potentially affected methods..
(cherry picked from commit 10cd00a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Commits on Oct 09, 2019
(cherry picked from commit 01171eb)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
…/unions. (GH-16589) (GH-16671)

(cherry picked from commit e8bedbd)
bpo-37531, bpo-38207: On timeout, regrtest no longer attempts to call
`popen.communicate() again: it can hang until all child processes
using stdout and stderr pipes completes. Kill the worker process and
ignores its output.

Reenable test_regrtest.test_multiprocessing_timeout().

bpo-37531: Change also the faulthandler timeout of the main process
from 1 minute to 5 minutes, for Python slowest buildbots.
(cherry picked from commit 0ec618a)

Co-authored-by: Victor Stinner <vstinner@python.org>
…H-16658) (GH-16683)

* [bpo-38379](https://bugs.python.org/issue38379):  when a finalizer resurrects an object,
nothing is actually collected in this run of gc.
Change the stats to relect that truth.
(cherry picked from commit ecbf35f)

Co-authored-by: Tim Peters <tim.peters@gmail.com>





https://bugs.python.org/issue38379



Automerge-Triggered-By: @pablogsal
Commits on Oct 10, 2019
(cherry picked from commit a05fcd3)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
PR GH-4906 changed the typing.Generic class hierarchy, leaving an
outdated comment in the library reference. User-defined Generic ABCs now
must get a abc.ABCMeta metaclass from something other than typing.Generic
inheritance.
(cherry picked from commit d47f0dd)

Co-authored-by: M. Eric Irrgang <mei2n@virginia.edu>
Add missing stat.S_IFDOOR, stat.S_IFPORT, stat.S_IFWHT,
stat.S_ISDOOR, stat.S_ISPORT, and stat.S_ISWHT values to
the Python implementation of the stat module.
(cherry picked from commit 7bb1431)

Co-authored-by: Ronan Lamy <ronan.lamy@gmail.com>
…-16591)

(cherry picked from commit 1dbe537)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
(cherry picked from commit f900064)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Commits on Oct 11, 2019
(cherry picked from commit a8e0d31)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
…H-16536)

 pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.
(cherry picked from commit 2b7dc40)

Co-authored-by: Ruediger Pluem <r.pluem@gmx.de>
We no longer use AppVeyor on 3.x, and others were still pointed at master.
(cherry picked from commit dd6117c)

Co-authored-by: bariod <35639254+bariod@users.noreply.github.com>
Commits on Oct 12, 2019
)

Add SMTPNotSupportedError in the exports of smtplib

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 3faf826)

Co-authored-by: nde <denayer.norman@gmail.com>
…low oper parsing of URLs" (GH-16724) (GH-16728)

This reverts commit 87bd207.

The reason for revert is a regression caused by the change in 3.8.0rc1, see bpo-38449 for more details.

https://bugs.python.org/issue38449
(cherry picked from commit 19a3d87)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
KeyError should cause a failure in parsing the encoded word and should be caught and raised as a _InvalidEWError instead.
(cherry picked from commit 65dcc8a)

Co-authored-by: Andrei Troie <andreitroie90@gmail.com>
This is a fairly noticeable change that requires adjustments in
existing asyncio code. It should therefore be announced.
(cherry picked from commit e634da2)

Co-authored-by: Phil Jones <philip.graham.jones@googlemail.com>
…IX_C_SOURCE (GH-16733)

(cherry picked from commit 8177404)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Commits on Oct 13, 2019
GH-16702)

(cherry picked from commit 793cb85)

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
(cherry picked from commit e3babbd)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
…ocs (GH-16743)

Metaclass was removed in Python 3.7 (there is already a `versionchanged` item about this).

https://bugs.python.org/issue28556
(cherry picked from commit 8144095)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
(cherry picked from commit fdfe283)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2 authors and ambv
* Use Unicode character for accent
* Various grammar fixes
* Sort library modules alphabetically; remove duplicated idlelib/IDLE section
(cherry picked from commit bb78f6c)

Co-authored-by: Andrew Kuchling <amk@amk.ca>
Commits on Oct 14, 2019
(cherry picked from commit c39d1dd)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
…H-16758)

(cherry picked from commit 8a6cbf8)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
…6762)

* bpo-38461: ncurses misspelled as curses

* bpo-38463: Fix broken link
(cherry picked from commit 61a6db5)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
)

(cherry picked from commit a329153)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
GH-16755) (#16760)

The symbol table handing of PEP572's assignment expressions is not resolving correctly the scope of some variables in presence of global/nonlocal keywords in conjunction with comprehensions.
(cherry picked from commit fd5c414)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 19d6842)

Co-authored-by: Ned Deily <nad@python.org>
(cherry picked from commit 298439c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit d83fc27)

Co-authored-by: Steve Dower <steve.dower@python.org>
(cherry picked from commit 274bd01)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Python 3.8.0
* [3.8] bpo-38456: Use /bin/true in test_subprocess (GH-16736)

Instead of sys.executable, "-c", "pass" or "import sys; sys.exit(0)"
use /bin/true when it is available.  On a reasonable machine this
shaves up to two seconds wall time off the otherwise ~40sec execution
on a --with-pydebug build.  It should be more notable on many
buildbots or overloaded slower I/O systems (CI, etc)..
(cherry picked from commit 67b93f8)

* Handle when there is no 'true' command

backport of 46113e0 by Pablo Galindo.
(cherry picked from commit 4504b45)

Co-authored-by: Julien Palard <julien@palard.fr>
(cherry picked from commit 4d20228)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Oct 15, 2019
* bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)

bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is
now also available in release mode. For example, it can be used to
debug a crash in the visit_decref() function of the GC.

Modify the following functions to also work in release mode:

* _PyDict_CheckConsistency()
* _PyObject_CheckConsistency()
* _PyType_CheckConsistency()
* _PyUnicode_CheckConsistency()

Other changes:

* _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL
  (equals to 0).
* _PyBytesWriter_CheckConsistency() now returns 1 and is only used
  with assert().
* Reorder _PyObject_Dump() to write safe fields first, and only
  attempt to render repr() at the end.

(cherry picked from commit 6876257)

* bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)

Fix _PyBytesWriter API when Python is built in release mode with
assertions.

(cherry picked from commit 60ec6ef)

* bpo-38070: Enhance visit_decref() debug trace (GH-16631)

subtract_refs() now pass the parent object to visit_decref() which
pass it to _PyObject_ASSERT(). So if the "is freed" assertion fails,
the parent is used in debug trace, rather than the freed object. The
parent object is more likely to contain useful information. Freed
objects cannot be inspected are are displayed as "<object at xxx is
freed>" with no other detail.

(cherry picked from commit 4d5f94b)

* Fix also a typo in PYMEM_DEADBYTE macro comment

* bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629)

Add a newline between the verbose object dump and the Py_FatalError()
logs for readability.

(cherry picked from commit 7775349)
…onal-only parameter (GH-16800)

(cherry picked from commit f3ef06a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 2798b60)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
(cherry picked from commit 3f36043)

Co-authored-by: Ned Deily <nad@python.org>
Commits on Oct 16, 2019
main() is now responsible to send the ANSWER, rather than
ServerProto. main() now waits until it got the HELLO before sending
the ANSWER over the new transport.

Previously, there was a race condition between main() replacing the
protocol and the protocol sending the ANSWER once it gets the HELLO.

TLSv1.3 was disabled for the test: reenable it.
(cherry picked from commit fab4ef2)

Co-authored-by: Victor Stinner <vstinner@python.org>
…GH-16824)

(cherry picked from commit 7aebbd1)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Oct 18, 2019
Also updates the documentation to clarify the situation surrounding
the digestmod parameter that is required despite its position in the
argument list as of 3.8.0 as well as removing old python2 era
references to "binary strings".

We indavertently had this raise ValueError in 3.8.0 for the missing
arg.  This is not considered an API change as no reasonable code would
be catching this missing argument error in order to handle it.
(cherry picked from commit f33c57d)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
(cherry picked from commit 93b81e1)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
Added periods at the end of the sentences.
(cherry picked from commit b1fa72a)

Co-authored-by: Jero Bado <tokidokitalkyou@gmail.com>
* bpo-27657: Fix urlparse() with numeric paths

Revert parsing decision from bpo-754016 in favor of the documented
consensus in bpo-16932 of how to treat strings without a // to
designate the netloc.

* bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs.
(cherry picked from commit 5a88d50)

Co-authored-by: Tim Graham <timograham@gmail.com>
…H-16670)

https://bugs.python.org/issue38418

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

Co-authored-by: Steve Dower <steve.dower@python.org>
(cherry picked from commit 5eabec0)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Commits on Oct 19, 2019
The Nose package is no longer maintained.
(cherry picked from commit 88eeda6)

Co-authored-by: Jon Dufresne <jon.dufresne@gmail.com>
…mpty dict (GH-16846)

The reverse iterator for empty dictionaries was not handling correctly shared-key dictionaries.
(cherry picked from commit 24dc2f8)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Commits on Oct 20, 2019
* math.perm() and math.comb()

* math.isqrt()

* Add singledispatchmethod()

* itertools.accumulate()

* Optional headers for xmlrpc.client.ServerProxy

* IDLE non-BMP characters

* import collections.abc directly

* @coroutine is deprecated

* pprint.pp()

* New options for object.__reduce__()

* DictReader no longer returns OrderedDicts

* "force" option for logging.basicConfig()

* Fix spelling

* cProfile context manager

* Various markup/grammar fixes from Kyle Stanley.
Other minor fixes as well.
Also, dedup the __reduce__ entry.

* Fix markup

* Fix grammar nits found by MS Word
(cherry picked from commit c93883c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
(cherry picked from commit 7414207)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
Commits on Oct 21, 2019
…H-16869)

(cherry picked from commit 5bc6a7c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…H-16860)

(cherry picked from commit 10ecbad)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Commits on Oct 22, 2019
Fix stdatomic.h header check for ICC compiler: the ICC implementation
lacks atomic_uintptr_t type which is needed by Python.

Test:

* atomic_int and atomic_uintptr_t types
* atomic_load_explicit() and atomic_store_explicit()
* memory_order_relaxed and memory_order_seq_cst constants

But don't test ATOMIC_VAR_INIT(): it's not used in Python.
(cherry picked from commit 028f734)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 91528f4)

Co-authored-by: Daniel Baskal <MagnificentUrukHai@users.noreply.github.com>
(cherry picked from commit dfe726b)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Commits on Oct 23, 2019
(cherry picked from commit 2e3d873)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit d34ac30)

Co-authored-by: Peter Bittner <django@bittner.it>
…GH-16901)

bpo-34679, bpo-38563: asyncio.ProactorEventLoop.close() now only calls
signal.set_wakeup_fd() in the main thread.
(cherry picked from commit 1b53a24)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 01659ca)

Co-authored-by: Ned Deily <nad@python.org>
Commits on Oct 24, 2019
(cherry picked from commit 3bbb6db)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
These are valid even in python 2.7

https://bugs.python.org/issue33348

Automerge-Triggered-By: @gpshead
(cherry picked from commit 96b06ae)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
Commits on Oct 25, 2019
numbers's -> number's
(cherry picked from commit 7320ec0)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
(cherry picked from commit cb2cf06)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Commits on Oct 26, 2019
… decorators. (GH-16861)

(cherry picked from commit 26ae9f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit d898d20)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 894e30c)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Oct 27, 2019
(cherry picked from commit e3f90b2)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit e31a79a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…H-16937)

Test by Daniel Hillier.
(cherry picked from commit 5c32af7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
)


(cherry picked from commit 85c6f8c)
Co-authored-by: Marco Rougeth <marco@rougeth.com>
Commits on Oct 28, 2019
(cherry picked from commit edb172a)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
(cherry picked from commit 794616f)

Co-authored-by: benedwards14 <53377856+benedwards14@users.noreply.github.com>
…C drive (GH-16968)

(cherry picked from commit 0ac6137)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Oct 29, 2019
(cherry picked from commit 457306b)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
…data. (GH-14656)

(cherry picked from commit da6ce58)

Co-authored-by: Daniel Hillier <daniel.hillier@gmail.com>
Update open() documentation.
Commits on Oct 30, 2019
…6992)

(cherry picked from commit 6c3e66a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
…n. (GH-16950) (GH-16999)

Replace all *NULL* with ``NULL``.
(cherry picked from commit 25fc088)
Also fix some other formatting.
(cherry picked from commit e835b31)
Commits on Oct 31, 2019
Change the url from docs.python-requests.org to requests.readthedocs.io
(cherry picked from commit 112f2b8)

Co-authored-by: Simon Legner <Simon.Legner@gmail.com>
(cherry picked from commit 65c7382)

Co-authored-by: MaT1g3R <peijun.ma@protonmail.com>
…H-16799) (GH-17016)

(cherry picked from commit 79d4ed1)
Commits on Nov 02, 2019
* Add missing test class (mistake in GH-4455)

* Increase coverage with 4 more test cases

* Rename neg_uid to huge_uid in test_modified_uid_huge

* Replace test_main() with unittest.main()

* Update plistlib docs.
(cherry picked from commit d0d9f7c)

Co-authored-by: Jon Janzen <jjjonjanzen@gmail.com>
Whenever I use `path.suffix` I have to check again whether it includes the dot or not. I decided to add it to the docstring so I won't have to keep checking.

https://bugs.python.org/issue38422

Automerge-Triggered-By: @pitrou
(cherry picked from commit 8d4fef4)

Co-authored-by: Ram Rachum <ram@rachum.com>
Commits on Nov 03, 2019
(cherry picked from commit d0e0f5b)

Co-authored-by: Dima Tisnek <dimaqq@gmail.com>
Commits on Nov 04, 2019
(cherry picked from commit 1cdadf4)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Commits on Nov 05, 2019
s/pathing/patching/
(cherry picked from commit 25fa3ec)

Co-authored-by: Michael Haas <micha2718l@gmail.com>
…acros in ``pythonrun.h``. (GH-17056)

(cherry picked from commit 62161ce)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
(cherry picked from commit 99b7701)

Co-authored-by: Борис Верховский <boris.verk@gmail.com>
GH-17026)

This was never intented to be called manually from PyInit_*.

Also, clarify PyState_RemoveModule return value.
(cherry picked from commit 9bc94ec)


Co-authored-by: Petr Viktorin <encukou@gmail.com>


https://bugs.python.org/issue38159



Automerge-Triggered-By: @encukou
Fixed what seemed to be a weird phrasing.

(cherry picked from commit 5e01a65)

Co-authored-by: Jules Lasne (jlasne) <jules.lasne@gmail.com>
Commits on Nov 06, 2019
…7043)

(cherry picked from commit 6552563)

Co-authored-by: Alexandru Ardelean <ardeleanalex@gmail.com>
(cherry picked from commit 56698d5)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Commits on Nov 07, 2019
…17078)

(cherry picked from commit 7f46049)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Commits on Nov 09, 2019
(cherry picked from commit befa032)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Commits on Nov 12, 2019
(cherry picked from commit 98480ce)

Co-authored-by: Jonathan Scholbach <j.scholbach@posteo.de>
…7111) (GH-17113)

(cherry picked from commit 733b9a3)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
…H-17103)

(cherry picked from commit c8b53dc)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Updates documentation around email.utils.parsedate_tz().

Currently, the documentation specifies that when a string without a is timezone passed to parsedate_tz(), the last tuple is returned as ```None```.

This is no longer true since Python 3.3


https://bugs.python.org/issue38421
(cherry picked from commit a12255d)


Co-authored-by: David K <dave@paddez.com>


https://bugs.python.org/issue38421



Automerge-Triggered-By: @encukou
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".
(cherry picked from commit 138ccbb)
…GH-17127)

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit d593881)

Co-authored-by: jsnklln <jsnklln@gmail.com>
…mode files. (GH-17136)

This change, which follows the behavior of C stdio's fdopen and Python 2's file object, allows pipes to be opened in append mode..
(cherry picked from commit 74fa9f7)
Commits on Nov 13, 2019
Contributions on bpo-26467 and bpo-29302.
(cherry picked from commit d6d6e2a)

Co-authored-by: Ilya Kulakov <kulakov.ilya@gmail.com>
(cherry picked from commit 2d56af7)

Co-authored-by: Shu <23287722+susan-shu-c@users.noreply.github.com>
This immediately toggles shell, editor, and output windows, but does not affect other input widgets.
(cherry picked from commit 9c28449)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
if parent `__init__` is not called from a constructor of object derived from `asyncio.Future`

https://bugs.python.org/issue38785
(cherry picked from commit dad6be5)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Commits on Nov 15, 2019
…H-17162)

(cherry picked from commit e8acc86)

Co-authored-by: Andrey Doroschenko <dorosch.github.io@yandex.ru>
…H-17039)

(cherry picked from commit b44ffc8)

Co-authored-by: Marco Paolini <mpaolini@users.noreply.github.com>
…GH-17176)

The C-API docs are a bit sparse on the interplay between C `fork()` and the CPython runtime.  This change adds some more information on the subject.

https://bugs.python.org/issue38816
(cherry picked from commit 73cdb0c)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
…H-17123)

Small docs update for [bpo-34651](https://bugs.python.org/issue34651).

Other references to fork (e.g. the PyOS.*Fork functions or discussions of fork() when embedding Python) point back to os.fork, so I don't think any other updates are needed.

https://bugs.python.org/issue38778

Automerge-Triggered-By: @ericsnowcurrently
(cherry picked from commit b220300)

Co-authored-by: Phil Connell <pconnell@gmail.com>
(cherry picked from commit 84f2528)

Co-authored-by: HongWeipeng <961365124@qq.com>
(cherry picked from commit 0fe0b88)

Co-authored-by: Jules Lasne (jlasne) <jules.lasne@gmail.com>
…H-16967)

Ensure isabs() is always True for \\?\ prefixed paths
Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly
Ensure shutil tests run in test directory
Commits on Nov 16, 2019
(cherry picked from commit 7c6130c)

Co-authored-by: Steve Dower <steve.dower@python.org>
changed 'This is bad class design, but save some typing'
into 'This is bad class design, but saves some typing'.
(cherry picked from commit d0acdfc)

Co-authored-by: Jason (Perry) Taylor <jtaylor@seek.com.au>
https://bugs.python.org/issue38823
(cherry picked from commit c3f6bdc)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Commits on Nov 17, 2019
https://bugs.python.org/issue38823
(cherry picked from commit 143a97f)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 4544e78)

Co-authored-by: alclarks <57201106+alclarks@users.noreply.github.com>
Commits on Nov 18, 2019
(cherry picked from commit 04c79d6)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
…-17221)

(cherry picked from commit 5383956)
https://bugs.python.org/issue38823
(cherry picked from commit 289cf0f)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
…7065)

`~` is now treated as an unreserved character (i.e. it doesn't get quoted), not a reserved one.
(cherry picked from commit f49f6ba)

Co-authored-by: Роман Донченко <dpb@corrigendum.ru>
…-17164)

https://bugs.python.org/issue38809
(cherry picked from commit ee703cb)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
(cherry picked from commit 00923c6)

Co-authored-by: Steve Dower <steve.dower@python.org>
https://bugs.python.org/issue38722

Automerge-Triggered-By: @taleinat
(cherry picked from commit e243bae)

Co-authored-by: jsnklln <jsnklln@gmail.com>
… single argument (GH-17243)

(cherry picked from commit dcf1f83)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Nov 19, 2019
…types (GH-17160) (GH-17249)

(cherry picked from commit fe75b62)

Co-authored-by: Tomás Farías <tomasfariassantana@gmail.com>
Automerge-Triggered-By: @csabella
(cherry picked from commit b1f160a)

Co-authored-by: Jules Lasne (jlasne) <jules.lasne@gmail.com>
Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator.

https://bugs.python.org/issue35409
(cherry picked from commit 8e0de2a)

Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
…7088)

This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`.

In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own).

This change forces the Process object to update its `native_id` attribute during the bootstrap process.

cc @vstinner

https://bugs.python.org/issue38707

Automerge-Triggered-By: @pitrou
(cherry picked from commit c6b20be)

Co-authored-by: Jake Tesler <jake.tesler@gmail.com>
…H-17250)

(cherry picked from commit ac22354)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Commits on Nov 20, 2019
These Format menu functions (default shortcuts Alt-T and Alt-U)
were mistakenly disabled in 3.7.5 and 3.8.0.
(cherry picked from commit b846247)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 33b671e)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit d51a363)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit be5c79e)

Co-authored-by: Federico Bond <federicobond@gmail.com>
…nix (GH-17294)

on platforms lacking a functional bind() for named unix domain sockets

https://bugs.python.org/issue38841

Automerge-Triggered-By: @asvetlov
(cherry picked from commit 559bad1)

Co-authored-by: xdegaye <xdegaye@gmail.com>
Commits on Nov 21, 2019
Fixed an incorrect sentence in Doc/c-api/mapping.rst I fell on
while translating the file.

skip issue

Automerge-Triggered-By: @csabella
(cherry picked from commit 06ca2a2)

Co-authored-by: Aveheuzed <a.masson555@ntymail.com>
Automerge-Triggered-By: @csabella
(cherry picked from commit 6db2fb7)

Co-authored-by: Jules Lasne (jlasne) <jules.lasne@gmail.com>
https://bugs.python.org/issue36277

Automerge-Triggered-By: @csabella
(cherry picked from commit 9391f6c)

Co-authored-by: Dave Nguyen <dv@dvnguyen.com>
This PR will make the following changes to the [_Built-in Functions_](https://docs.python.org/3/library/functions.html) chapter of the library documentation:

- improve hyperlinks in Sphinx roles (trailing 's' belong to hyperlinks).

Automerge-Triggered-By: @csabella
(cherry picked from commit d672791)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
test_capi: trashcan tests now require the test "cpu" resource.
(cherry picked from commit 0127bb1)

Co-authored-by: Victor Stinner <vstinner@python.org>
GH-17126)

https://bugs.python.org/issue37838
(cherry picked from commit 0aca3a3)

Co-authored-by: benedwards14 <53377856+benedwards14@users.noreply.github.com>
… fix [3.8] (GH-17269) (#17304)

(cherry picked from commit 046442d)

Co-authored-by: Jason Fried <fried@fb.com>
(cherry picked from commit 65444cf)

Co-authored-by: Claudiu Popa <pcmanticore@gmail.com>
Commits on Nov 22, 2019
Increment properly Py_True/Py_False reference counter for
_testcapi.WITH_PYMALLOC variable.
…-17252)

(cherry picked from commit 9960230)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
The regex http.cookiejar.LOOSE_HTTP_DATE_RE was vulnerable to regular
expression denial of service (REDoS).

LOOSE_HTTP_DATE_RE.match is called when using http.cookiejar.CookieJar
to parse Set-Cookie headers returned by a server.
Processing a response from a malicious HTTP server can lead to extreme
CPU usage and execution will be blocked for a long time.

The regex contained multiple overlapping \s* capture groups.
Ignoring the ?-optional capture groups the regex could be simplified to

    \d+-\w+-\d+(\s*\s*\s*)$

Therefore, a long sequence of spaces can trigger bad performance.

Matching a malicious string such as

    LOOSE_HTTP_DATE_RE.match("1-c-1" + (" " * 2000) + "!")

caused catastrophic backtracking.

The fix removes ambiguity about which \s* should match a particular
space.

You can create a malicious server which responds with Set-Cookie headers
to attack all python programs which access it e.g.

    from http.server import BaseHTTPRequestHandler, HTTPServer

    def make_set_cookie_value(n_spaces):
        spaces = " " * n_spaces
        expiry = f"1-c-1{spaces}!"
        return f"b;Expires={expiry}"

    class Handler(BaseHTTPRequestHandler):
        def do_GET(self):
            self.log_request(204)
            self.send_response_only(204)  GH- Don't bother sending Server and Date
            n_spaces = (
                int(self.path[1:])  GH- Can GET e.g. /100 to test shorter sequences
                if len(self.path) > 1 else
                65506  GH- Max header line length 65536
            )
            value = make_set_cookie_value(n_spaces)
            for i in range(99):  GH- Not necessary, but we can have up to 100 header lines
                self.send_header("Set-Cookie", value)
            self.end_headers()

    if __name__ == "__main__":
        HTTPServer(("", 44020), Handler).serve_forever()

This server returns 99 Set-Cookie headers. Each has 65506 spaces.
Extracting the cookies will pretty much never complete.

Vulnerable client using the example at the bottom of
https://docs.python.org/3/library/http.cookiejar.html :

    import http.cookiejar, urllib.request
    cj = http.cookiejar.CookieJar()
    opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
    r = opener.open("http://localhost:44020/")

The popular requests library was also vulnerable without any additional
options (as it uses http.cookiejar by default):

    import requests
    requests.get("http://localhost:44020/")

* Regression test for http.cookiejar REDoS

If we regress, this test will take a very long time.

* Improve performance of http.cookiejar.ISO_DATE_RE

A string like

"444444" + (" " * 2000) + "A"

could cause poor performance due to the 2 overlapping \s* groups,
although this is not as serious as the REDoS in LOOSE_HTTP_DATE_RE was.
(cherry picked from commit 1b779bf)

Co-authored-by: bcaller <bcaller@users.noreply.github.com>
The Y2K reference is not needed as it only points out that Python's use
of C standard functions doesn't generally suffer from Y2K issues; the
point regarding conventions for conversion of 2-digit years in
:func:`strptime` is still valid.
(cherry picked from commit 42bc60e)

Co-authored-by: Callum Ward <wards.callum@gmail.com>
* fix HTTP Digest handling in request.py

There is a bug triggered when server replies to a request with `WWW-Authenticate: Digest` where `qop="auth,auth-int"` rather than mere `qop="auth"`. Having both `auth` and `auth-int` is legitimate according to the `qop-options` rule in §3.2.1 of [[https://www.ietf.org/rfc/rfc2617.txt|RFC 2617]]:
>      qop-options       = "qop" "=" <"> 1GH-qop-value <">
>      qop-value         = "auth" | "auth-int" | token
> **qop-options**: [...] If present, it is a quoted string **of one or more** tokens indicating the "quality of protection" values supported by the server.  The value `"auth"` indicates authentication; the value `"auth-int"` indicates authentication with integrity protection

This is description confirmed by the definition of the [//n//]`GH-`[//m//]//rule// extended-BNF pattern defined in §2.1 of [[https://www.ietf.org/rfc/rfc2616.txt|RFC 2616]] as 'a comma-separated list of //rule// with at least //n// and at most //m// items'.

When this reply is parsed by `get_authorization`, request.py only tests for identity with `'auth'`, failing to recognize it as one of the supported modes the server announced, and claims that `"qop 'auth,auth-int' is not supported"`.

* 📜🤖 Added by blurb_it.

* bpo-38686 review fix: remember why.

* fix trailing space in Lib/urllib/request.py

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 14a89c4)

Co-authored-by: PypeBros <PypeBros@users.noreply.github.com>
Commits on Nov 25, 2019
(cherry picked from commit f8a6316)

Co-authored-by: Sanchit Khurana <54467174+GeniusLearner@users.noreply.github.com>
Commits on Nov 26, 2019
(cherry picked from commit 386d00c)

Co-authored-by: David Coles <coles.david@gmail.com>
(cherry picked from commit e563a15)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Commits on Nov 27, 2019
…is called (GH-17394)

(cherry picked from commit c7c01ab)

Co-authored-by: Steve Dower <steve.dower@python.org>
…H-17366)

Extra newlines are removed at the end of non-shell files. If the file only has newlines after stripping other trailing whitespace, all are removed, as is done by patchcheck.py.
(cherry picked from commit 6bf644e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
… entries to prevent infinite recursion (GH-17397)

(cherry picked from commit 9bbcbc9)

Co-authored-by: Bruno P. Kinoshita <kinow@users.noreply.github.com>
…et_name__ (GH-17364)

(cherry picked from commit 1bddf89)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
Commits on Nov 28, 2019
SpooledTemporaryFile.rollback() might cause data corruption
when it is in text mode.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit ea9835c)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
(cherry picked from commit 02519f7)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
…hook are invoked (GH-17392)

Also fixes some potential segfaults in unraisable hook handling.
Commits on Nov 29, 2019
Commits on Dec 01, 2019
(cherry picked from commit 575d0b4)

Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
(cherry picked from commit fdafa1d)

Co-authored-by: idomic <michael.ido@gmail.com>
* bpo-38449: Add tricky test cases

* bpo-38449: Reflect codereview
(cherry picked from commit 2fe4c48)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Commits on Dec 02, 2019
Make ssl tests less strict and also accept TLSv3 as the default maximum
version. This change unbreaks test_min_max_version on Fedora 32.

https://bugs.python.org/issue38815
(cherry picked from commit 34864d1)

Co-authored-by: torsava <torsava@redhat.com>
…put format (GH-17418)

(cherry picked from commit a62ad47)

Co-authored-by: Matthew Rollings <1211162+stealthcopter@users.noreply.github.com>
Commits on Dec 03, 2019
Update docstring for `multiprocessing.Pool.map` to mention `pool.starmap()`.

Prev PR: #17367  @aeros

https://bugs.python.org/issue27873
(cherry picked from commit eb48a45)

Co-authored-by: An Long <aisk@users.noreply.github.com>
Commits on Dec 04, 2019
(cherry picked from commit 808769f)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
The readline module now detects if Python is linked to libedit at runtime
on all platforms.  Previously, the check was only done on macOS.

If Python is used as a library by a binary linking to libedit, the linker
resolves the rl_initialize symbol required by the readline module against
libedit instead of libreadline, which leads to a segfault.

Take advantage of the existing supporting code to have readline module being
compatible with both situations.
(cherry picked from commit 7105319)

Co-authored-by: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
Use the "volatile" keyword to prevent tail call optimization
on any compiler, rather than relying on compiler specific pragma.
(cherry picked from commit 8b78796)

Co-authored-by: Victor Stinner <vstinner@python.org>
Commits on Dec 05, 2019
…H-17450)

Since c64a1a6 two assertions were indented and thus ignored when running test_hmac.

This PR fixes it. As the change is quite trivial I didn't add a NEWS entry.


https://bugs.python.org/issue38270
(cherry picked from commit 8943318)


Co-authored-by: stratakis <cstratak@redhat.com>


https://bugs.python.org/issue38270



Automerge-Triggered-By: @tiran
…H-17277)

parse_message_id() was improperly using a token defined inside an exception
handler, which was raising `UnboundLocalError` on parsing an invalid value.

https://bugs.python.org/issue38698
(cherry picked from commit bb81549)

Co-authored-by: Claudiu Popa <pcmanticore@gmail.com>
Commits on Dec 06, 2019
GH-13135)

Break cycle generated when saving an exception in socket.py, codeop.py and dyld.py as they keep alive not only the exception but user objects through the ``__traceback__`` attribute.

https://bugs.python.org/issue36820

Automerge-Triggered-By: @pablogsal
(cherry picked from commit b64334c)

Co-authored-by: Mario Corchero <mcorcherojim@bloomberg.net>
…ges (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.
On most platforms, the `environ` symbol is accessible everywhere.

In a dylib on OSX, it's not easily accessible, you need to find it with
_NSGetEnviron.

The code was caching the *value* of environ. But a setenv() can change the value,
leaving garbage at the old value. Fix: don't cache the value of environ, just
read it every time.
(cherry picked from commit 723f71a)

Co-authored-by: Benoit Hudson <benoit@imgspc.com>
Commits on Dec 07, 2019
(cherry picked from commit 7ddcd0c)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
…Python version (GH-17484)

(cherry picked from commit 969ae7a)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
…ncio functions (GH-16457) (#17496)

https://bugs.python.org/issue37404
(cherry picked from commit 892f9e0)

Co-authored-by: idomic <michael.ido@gmail.com>
test_openssl_version now accepts version 3.0.0.

getpeercert() no longer returns IPv6 addresses with a trailing new line.

Signed-off-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38820
(cherry picked from commit 2b7de66)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38820



Automerge-Triggered-By: @tiran
Commits on Dec 08, 2019
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None.

https://bugs.python.org/issue38979

Automerge-Triggered-By: @asvetlov
(cherry picked from commit 28c9163)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
Commits on Dec 09, 2019
…H-17503)

This adds a new InvalidMessageID token to the email header parser which can be
used to represent invalid message-id headers in the parse tree.
(cherry picked from commit 68157da)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
…H-17504)

Fix a potential IndexError when passing an empty value to the message-id
parser. Instead, HeaderParseError should be raised.
(cherry picked from commit 3ae4ea1)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
…espace (GH-17421)

https://bugs.python.org/issue38673
(cherry picked from commit 109fc27)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
This means a clearer message is now shown when patch.object is called with two string arguments, rather than a class and a string argument.
(cherry picked from commit cd90a52)

Co-authored-by: Elena Oat <oat.elena@gmail.com>
Fix test_pty: if the process is the session leader, closing the
master file descriptor raises a SIGHUP signal: simply ignore SIGHUP
when running the tests.
(cherry picked from commit a1838ec)

Co-authored-by: Victor Stinner <vstinner@python.org>
array.array: Document that tostring() and fromstring() deprecated
aliases will be removed in Python 3.9.
Fix asyncio when the ssl module is missing: only check for
ssl.SSLSocket instance if the ssl module is available.
(cherry picked from commit 82b4950)

Co-authored-by: Victor Stinner <vstinner@python.org>
GH-17311) (#17529)

(cherry picked from commit ab513a3)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
…H-9518) (#17531)

(cherry picked from commit d219cc4)

Co-authored-by: Yury Selivanov <yury@magic.io>
(cherry picked from commit e89e159)

Co-authored-by: Steve Dower <steve.dower@python.org>
…H-17530)

* Issue 38992: avoid fsum test failure

* Add NEWS entry
(cherry picked from commit bba873e)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
…se a deprecation warning (GH-17540)

(cherry picked from commit b8cbe74)

Co-authored-by: Steve Dower <steve.dower@python.org>
Also allows winreg.CloseKey() to accept same types as other functions.
(cherry picked from commit ee17e37)

Co-authored-by: Steve Dower <steve.dower@python.org>
(cherry picked from commit 232689b)

Co-authored-by: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com>
Commits on Dec 10, 2019
This has happened on some versions of Ubuntu.
(cherry picked from commit bbc4162)

Co-authored-by: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com>
…17538)

(cherry picked from commit c18b805)

Co-authored-by: Tim Gates <tim.gates@iress.com>
(cherry picked from commit abdeb57)

Co-authored-by: Steve Dower <steve.dower@python.org>
Python 3.8.1rc1
Automerge-Triggered-By: @pablogsal
(cherry picked from commit d0802d0)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Dec 11, 2019
…-17569)

* bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 including improved docs for custom finders and better serialization support in EntryPoints.

* 📜🤖 Added by blurb_it.

* Correct module reference
(cherry picked from commit b7a0109)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Commits on Dec 13, 2019
… for if_stmt (GH-17582) (GH-17589)

When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node.

https://bugs.python.org/issue39031

Automerge-Triggered-By: @pablogsal
(cherry picked from commit 025a602)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
(cherry picked from commit 8289e27)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
Commits on Dec 14, 2019
Co-Authored-By: Victor Stinner <vstinner@python.org>
(cherry picked from commit 95826c7)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
… (GH-17600)

(cherry picked from commit 5936a4c)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Commits on Dec 15, 2019
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit b08d3f7)

Co-authored-by: Guido van Rossum <guido@python.org>
Showing 1,061 changed files with 46,793 additions and 25,820 deletions.
@@ -42,7 +42,7 @@ jobs:
testRunPlatform: macos

pool:
vmImage: xcode9-macos10.13
vmImage: macos-10.14

steps:
- template: ./macos-steps.yml
@@ -59,7 +59,7 @@ jobs:
variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
openssl_version: 1.1.1c
openssl_version: 1.1.1d

steps:
- template: ./posix-steps.yml
@@ -116,7 +116,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1c
openssl_version: 1.1.1d

steps:
- template: ./posix-steps.yml
@@ -131,7 +131,7 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

pool:
vmImage: vs2017-win2016
vmImage: windows-2019

strategy:
matrix:
@@ -145,7 +145,7 @@ jobs:
buildOpt: '-p x64'
testRunTitle: '$(Build.SourceBranchName)-win64'
testRunPlatform: win64
maxParallel: 2
maxParallel: 4

steps:
- template: ./windows-steps.yml
@@ -14,6 +14,8 @@ steps:

- script: make buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
displayName: 'Tests'
continueOnError: true
timeoutInMinutes: 30

- task: PublishTestResults@2
displayName: 'Publish Test Results'
@@ -40,7 +40,7 @@ jobs:
testRunPlatform: macos

pool:
vmImage: xcode9-macos10.13
vmImage: macos-10.14

steps:
- template: ./macos-steps.yml
@@ -59,7 +59,7 @@ jobs:
variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
testRunPlatform: linux
openssl_version: 1.1.1c
openssl_version: 1.1.1d

steps:
- template: ./posix-steps.yml
@@ -116,7 +116,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1c
openssl_version: 1.1.1d

steps:
- template: ./posix-steps.yml
@@ -131,7 +131,7 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

pool:
vmImage: vs2017-win2016
vmImage: windows-2019

strategy:
matrix:
@@ -145,7 +145,10 @@ jobs:
buildOpt: '-p x64'
testRunTitle: '$(System.PullRequest.TargetBranch)-win64'
testRunPlatform: win64
maxParallel: 2
winarm64:
arch: arm64
buildOpt: '-p arm64'
maxParallel: 4

steps:
- template: ./windows-steps.yml
@@ -0,0 +1,129 @@
name: Release_$(Build.SourceBranchName)_$(SourceTag)_$(Date:yyyyMMdd)$(Rev:.rr)

variables:
__RealSigningCertificate: 'Python Software Foundation'
# QUEUE TIME VARIABLES
# GitRemote: python
# SourceTag:
# DoPGO: true
# SigningCertificate: 'Python Software Foundation'
# SigningDescription: 'Built: $(Build.BuildNumber)'
# DoLayout: true
# DoMSIX: true
# DoNuget: true
# DoEmbed: true
# DoMSI: true
# DoPublish: false
# PyDotOrgUsername: ''
# PyDotOrgServer: ''
# BuildToPublish: ''

trigger: none
pr: none

stages:
- stage: Build
displayName: Build binaries
condition: and(succeeded(), not(variables['BuildToPublish']))
jobs:
- template: windows-release/stage-build.yml

- stage: Sign
displayName: Sign binaries
dependsOn: Build
condition: and(succeeded(), not(variables['BuildToPublish']))
jobs:
- template: windows-release/stage-sign.yml

- stage: Layout
displayName: Generate layouts
dependsOn: Sign
condition: and(succeeded(), not(variables['BuildToPublish']))
jobs:
- template: windows-release/stage-layout-full.yml
- template: windows-release/stage-layout-embed.yml
- template: windows-release/stage-layout-nuget.yml

- stage: Pack
dependsOn: Layout
condition: and(succeeded(), not(variables['BuildToPublish']))
jobs:
- template: windows-release/stage-pack-nuget.yml

- stage: Test
dependsOn: Pack
condition: and(succeeded(), not(variables['BuildToPublish']))
jobs:
- template: windows-release/stage-test-embed.yml
- template: windows-release/stage-test-nuget.yml

- stage: Layout_MSIX
displayName: Generate MSIX layouts
dependsOn: Sign
condition: and(succeeded(), and(eq(variables['DoMSIX'], 'true'), not(variables['BuildToPublish'])))
jobs:
- template: windows-release/stage-layout-msix.yml

- stage: Pack_MSIX
displayName: Package MSIX
dependsOn: Layout_MSIX
condition: and(succeeded(), not(variables['BuildToPublish']))
jobs:
- template: windows-release/stage-pack-msix.yml

- stage: Build_MSI
displayName: Build MSI installer
dependsOn: Sign
condition: and(succeeded(), and(eq(variables['DoMSI'], 'true'), not(variables['BuildToPublish'])))
jobs:
- template: windows-release/stage-msi.yml

- stage: Test_MSI
displayName: Test MSI installer
dependsOn: Build_MSI
condition: and(succeeded(), not(variables['BuildToPublish']))
jobs:
- template: windows-release/stage-test-msi.yml

- stage: PublishPyDotOrg
displayName: Publish to python.org
dependsOn: ['Test_MSI', 'Test']
condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), not(variables['BuildToPublish'])))
jobs:
- template: windows-release/stage-publish-pythonorg.yml

- stage: PublishNuget
displayName: Publish to nuget.org
dependsOn: Test
condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), not(variables['BuildToPublish'])))
jobs:
- template: windows-release/stage-publish-nugetorg.yml

- stage: PublishStore
displayName: Publish to Store
dependsOn: Pack_MSIX
condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), not(variables['BuildToPublish'])))
jobs:
- template: windows-release/stage-publish-store.yml


- stage: PublishExistingPyDotOrg
displayName: Publish existing build to python.org
dependsOn: []
condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), variables['BuildToPublish']))
jobs:
- template: windows-release/stage-publish-pythonorg.yml

- stage: PublishExistingNuget
displayName: Publish existing build to nuget.org
dependsOn: []
condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), variables['BuildToPublish']))
jobs:
- template: windows-release/stage-publish-nugetorg.yml

- stage: PublishExistingStore
displayName: Publish existing build to Store
dependsOn: []
condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), variables['BuildToPublish']))
jobs:
- template: windows-release/stage-publish-store.yml
@@ -0,0 +1,84 @@
parameters:
ShouldPGO: false

steps:
- template: ./checkout.yml

- powershell: |
$d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }};
Write-Host "##vso[task.setvariable variable=VersionText]$($d.PythonVersion)"
Write-Host "##vso[task.setvariable variable=VersionNumber]$($d.PythonVersionNumber)"
Write-Host "##vso[task.setvariable variable=VersionHex]$($d.PythonVersionHex)"
Write-Host "##vso[task.setvariable variable=VersionUnique]$($d.PythonVersionUnique)"
Write-Host "##vso[build.addbuildtag]$($d.PythonVersion)"
Write-Host "##vso[build.addbuildtag]$($d.PythonVersion)-$(Name)"
displayName: 'Extract version numbers'

- ${{ if eq(parameters.ShouldPGO, 'false') }}:
- powershell: |
$env:SigningCertificate = $null
.\PCbuild\build.bat -v -p $(Platform) -c $(Configuration)
displayName: 'Run build'
env:
IncludeUwp: true
Py_OutDir: '$(Build.BinariesDirectory)\bin'
- ${{ if eq(parameters.ShouldPGO, 'true') }}:
- powershell: |
$env:SigningCertificate = $null
.\PCbuild\build.bat -v -p $(Platform) --pgo
displayName: 'Run build with PGO'
env:
IncludeUwp: true
Py_OutDir: '$(Build.BinariesDirectory)\bin'
- powershell: |
$kitroot = (gp 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\').KitsRoot10
$tool = (gci -r "$kitroot\Bin\*\x64\signtool.exe" | sort FullName -Desc | select -First 1)
if (-not $tool) {
throw "SDK is not available"
}
Write-Host "##vso[task.prependpath]$($tool.Directory)"
displayName: 'Add WinSDK tools to path'

- powershell: |
$env:SigningCertificate = $null
$(_HostPython) PC\layout -vv -b "$(Build.BinariesDirectory)\bin" -t "$(Build.BinariesDirectory)\catalog" --catalog "${env:CAT}.cdf" --preset-default --arch $(Arch)
makecat "${env:CAT}.cdf"
del "${env:CAT}.cdf"
if (-not (Test-Path "${env:CAT}.cat")) {
throw "Failed to build catalog file"
}
displayName: 'Generate catalog'
env:
CAT: $(Build.BinariesDirectory)\bin\$(Arch)\python
PYTHON_HEXVERSION: $(VersionHex)

- task: PublishPipelineArtifact@0
displayName: 'Publish binaries'
condition: and(succeeded(), not(and(eq(variables['Configuration'], 'Release'), variables['SigningCertificate'])))
inputs:
targetPath: '$(Build.BinariesDirectory)\bin\$(Arch)'
artifactName: bin_$(Name)

- task: PublishPipelineArtifact@0
displayName: 'Publish binaries for signing'
condition: and(succeeded(), and(eq(variables['Configuration'], 'Release'), variables['SigningCertificate']))
inputs:
targetPath: '$(Build.BinariesDirectory)\bin\$(Arch)'
artifactName: unsigned_bin_$(Name)

- task: CopyFiles@2
displayName: 'Layout Artifact: symbols'
inputs:
sourceFolder: $(Build.BinariesDirectory)\bin\$(Arch)
targetFolder: $(Build.ArtifactStagingDirectory)\symbols\$(Name)
flatten: true
contents: |
**\*.pdb
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: symbols'
inputs:
PathToPublish: '$(Build.ArtifactStagingDirectory)\symbols'
ArtifactName: symbols
@@ -0,0 +1,21 @@
parameters:
depth: 3

steps:
- checkout: none

- script: git clone --progress -v --depth ${{ parameters.depth }} --branch $(SourceTag) --single-branch https://github.com/$(GitRemote)/cpython.git .
displayName: 'git clone ($(GitRemote)/$(SourceTag))'
condition: and(succeeded(), and(variables['GitRemote'], variables['SourceTag']))

- script: git clone --progress -v --depth ${{ parameters.depth }} --branch $(SourceTag) --single-branch $(Build.Repository.Uri) .
displayName: 'git clone (<default>/$(SourceTag))'
condition: and(succeeded(), and(not(variables['GitRemote']), variables['SourceTag']))

- script: git clone --progress -v --depth ${{ parameters.depth }} --branch $(Build.SourceBranchName) --single-branch https://github.com/$(GitRemote)/cpython.git .
displayName: 'git clone ($(GitRemote)/<default>)'
condition: and(succeeded(), and(variables['GitRemote'], not(variables['SourceTag'])))

- script: git clone --progress -v --depth ${{ parameters.depth }} --branch $(Build.SourceBranchName) --single-branch $(Build.Repository.Uri) .
displayName: 'git clone'
condition: and(succeeded(), and(not(variables['GitRemote']), not(variables['SourceTag'])))
@@ -0,0 +1,17 @@
# Locate the Windows SDK and add its binaries directory to PATH
#
# `toolname` can be overridden to use a different marker file.

parameters:
toolname: signtool.exe

steps:
- powershell: |
$kitroot = (gp 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\').KitsRoot10
$tool = (gci -r "$kitroot\Bin\*\${{ parameters.toolname }}" | sort FullName -Desc | select -First 1)
if (-not $tool) {
throw "SDK is not available"
}
Write-Host "##vso[task.prependpath]$($tool.Directory)"
Write-Host "Adding $($tool.Directory) to PATH"
displayName: 'Add WinSDK tools to path'
@@ -0,0 +1,28 @@
parameters:
GPGKeyFile: $(GPGKey)
GPGPassphrase: $(GPGPassphrase)
Files: '*'
WorkingDirectory: $(Build.BinariesDirectory)

steps:
- task: DownloadSecureFile@1
name: gpgkey
inputs:
secureFile: ${{ parameters.GPGKeyFile }}
displayName: 'Download GPG key'

- powershell: |
git clone https://github.com/python/cpython-bin-deps --branch gpg --single-branch --depth 1 --progress -v "gpg"
gpg/gpg2.exe --import "$(gpgkey.secureFilePath)"
(gci -File ${{ parameters.Files }}).FullName | %{
gpg/gpg2.exe -ba --batch --passphrase ${{ parameters.GPGPassphrase }} $_
"Made signature for $_"
}
displayName: 'Generate GPG signatures'
workingDirectory: ${{ parameters.WorkingDirectory }}

- powershell: |
$p = gps "gpg-agent" -EA 0
if ($p) { $p.Kill() }
displayName: 'Kill GPG agent'
condition: true

Showing you all comments on commits in this comparison.

@aeros

This comment has been minimized.

Copy link
Member

aeros commented on 6067e1d Oct 11, 2019

@zooba Is there a particular reason why these error codes can't be constants instead of using comments to explain each error? This would allow the usage of:

allowed_winerror = (
    ERROR_INVALID_FUNCTION,
    ERROR_FILE_NOT_FOUND,
    ERROR_DIRECTORY_NOT_FOUND,
    # ...
)

Of course this is not at all urgent and would probably not be worth a last minute change to 3.8 since it's mostly just a readability change (especially considering that we're 4 days from release), I'm just curious if you think this might be a viable improvement for 3.9.

You can’t perform that action at this time.