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
DalavanCloud/cpython
DarkmaneTheRobot/cpython
Darshan-excellence/cpython
EpicWink/cpython
ErikHendriks/cpython
Frankenstein1836/cpython
FrostyFeng/cpython
GPHemsley/cpython
HeidiWindkraft/strict_cpython
JacksonKearl/cpython
Jesse-Bakker/cpython
Kamos86/cpython
KanesAccount/cpython
KrzysztofSzewczyk/Zaskroniec
LALINUX2019/cpython
LenochkaNSK18/cpython
Li-Michael/cpython
Longinushadow/cpython
Longturd/cpython
MuhammadZubair210/cpython
Munyola/cpython
Neo23x0/cpython
NoahGWood/cpython
OnePPCDev/cpython
OpenGemini/cpython
PadmajaVB/cpython
PatrickRudgeri/cpython
PraveenChaudhary/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
ZhangYunfang/cpython
aclements/cpython
agoose77/cpython
ahcub/cpython
airboat/cpython
aixtools/cpython
ajayjoshi879/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
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
ohei/cpython
oranav/cpython
pablogsal/cpython
passengeryjy/cpython
pedrorhian944/cpython
podshumok/cpython
pomidoroshev/cpython
pxinwr/cpython
pynickle/cpython
pythoncapi/cpython
ratnania/cpython
rdb/cpython
refoo/cpython
remitamine/cpython
rhettinger/cpython
rkialashaki/cpython
rohitsr24/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
stealthcopter/cpython
sthagen/cpython
subhashissuara/cpython
sudonitesh/cpython
supitchayapat/cpython
swizl/cnpython
taborda11/cpython
thomascherickal/cpython
tiangolo/cpython
tim-one/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
ycq091044/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
DalavanCloud/cpython
DarkmaneTheRobot/cpython
Darshan-excellence/cpython
EpicWink/cpython
ErikHendriks/cpython
Frankenstein1836/cpython
FrostyFeng/cpython
GPHemsley/cpython
HeidiWindkraft/strict_cpython
JacksonKearl/cpython
Jesse-Bakker/cpython
Kamos86/cpython
KanesAccount/cpython
KrzysztofSzewczyk/Zaskroniec
LALINUX2019/cpython
LenochkaNSK18/cpython
Li-Michael/cpython
Longinushadow/cpython
Longturd/cpython
MuhammadZubair210/cpython
Munyola/cpython
Neo23x0/cpython
NoahGWood/cpython
OnePPCDev/cpython
OpenGemini/cpython
PadmajaVB/cpython
PatrickRudgeri/cpython
PraveenChaudhary/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
ZhangYunfang/cpython
aclements/cpython
agoose77/cpython
ahcub/cpython
airboat/cpython
aixtools/cpython
ajayjoshi879/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
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
ohei/cpython
oranav/cpython
pablogsal/cpython
passengeryjy/cpython
pedrorhian944/cpython
podshumok/cpython
pomidoroshev/cpython
pxinwr/cpython
pynickle/cpython
pythoncapi/cpython
ratnania/cpython
rdb/cpython
refoo/cpython
remitamine/cpython
rhettinger/cpython
rkialashaki/cpython
rohitsr24/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
stealthcopter/cpython
sthagen/cpython
subhashissuara/cpython
sudonitesh/cpython
supitchayapat/cpython
swizl/cnpython
taborda11/cpython
thomascherickal/cpython
tiangolo/cpython
tim-one/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
ycq091044/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.5
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 May 14, 2017
(cherry picked from commit 9977629)
Commits on May 16, 2017
…H-1595) (#1605)

Warnings emitted when compile a regular expression now always point
to the line in the user code.  Previously they could point into inners
of the re module if emitted from inside of groups or conditionals..
(cherry picked from commit c7ac728)
(cherry picked from commit 1bd7d29)
Catch the Windows socket WSAEINVAL error (code 10022) in imaplib and
poplib on shutdown(SHUT_RDWR): An invalid operation was attempted

This error occurs sometimes on SSL connections.
(cherry picked from commit 83a2c28)
Commits on May 17, 2017
test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.

Co-Authored-By:  Grzegorz Grzywacz <[email protected]>
(cherry picked from commit 79ef7f8)
…1515) (#1626)

compiled out-of-tree (builddir != srcdir). (see also bpo-15366)
(cherry picked from commit dbdea62)
…1627)

Under *spawn* and *forkserver* start methods, SimpleQueue.empty() could
raise AttributeError due to not setting _poll in __setstate__.
test_is_alive_after_fork() now joins directly the thread to avoid the
following warning added by bpo-30357:

Warning -- threading_cleanup() failed to cleanup 0 threads
after 2 sec (count: 0, dangling: 21)

Use also a different exit code to catch generic exit code 1.
(cherry picked from commit f8d05b3)
Commits on May 19, 2017
Workaround for a regrtest bug.
Commits on May 20, 2017
…names. (GH-1652) (#1674)

Based on patch by Eryk Sun.
(cherry picked from commit d896985)
Based on patches by Duane Griffin and Tim Mitchell.
(cherry picked from commit 753bca3)
Commits on May 21, 2017
Commits on May 23, 2017
Ran the docstrings through spell checker, and fixed spelling issues.
(cherry picked from commit 21b3e04)
Commits on May 24, 2017
The library does not enforce compliance with the HTTP protocol,
so violations are not technically disallowed. Extend the stream's
description to avoid suggesting that intentional protocol violations are
not supported.
(cherry picked from commit a083c8e)
Commits on May 25, 2017
…oop on exc (GH-1683) (#1816)

* bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc

Queue background running thread was not handling exceptions correctly.
Any exception occurred inside thread (putting unpickable object) cause
feeder to finish running. After that every message put into queue is
silently ignored.

* bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc

Queue background running thread was not handling exceptions correctly.
Any exception occurred inside thread (putting unpickable object) cause
feeder to finish running. After that every message put into queue is
silently ignored.
(cherry picked from commit bc50f03)
Commits on May 27, 2017
…) (#1829)

Unlikely to the simplejson module, json.JSONDecodeError doesn't accept the end argument.
(cherry picked from commit 5becf38)
Also document that some attributes may be None.
(cherry picked from commit 12d6b5d)
Commits on May 29, 2017
Commits on May 30, 2017
…1869)

The data model section of the language reference was written well
before the zero-argument form of super() was added.

To avoid giving the impression that they're doing something
unusual, this updates the description of `__new__` and `__init__`
to use the zero-argument form.

Patch by Cheryl Sabella.
(cherry picked from commit 12b1c18)
(cherry picked from commit eba68e2)
Commits on May 31, 2017
(cherry picked from commit f34c685)
Commits on Jun 01, 2017
…H-1896)

The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition.
(cherry picked from commit 08e2f35)
(cherry picked from commit 0737ee2)
Commits on Jun 02, 2017
Commits on Jun 03, 2017
Initially the macOS builds are allowed to fail until such time that they can be determined to be stable and not add an unacceptable amount of time to the overall Travis-passing process.
(cherry picked from commit 21c2dd7)
Commits on Jun 04, 2017
… being raised (GH-1920)

We get `ERROR_BAD_NETPATH` (53) on AppVeyor which is translated to
ENOENT (2).
(cherry picked from commit 7a99625)
Commits on Jun 05, 2017
Also on the short-lived `buildbot-custom` branch.
(cherry picked from commit d3bedf3)
Update the code example in Functions and Methods section
Remove objtype argument in MethodType
(cherry picked from commit 1bced56)
…H-1944)

* bpo-30538: Update count() in Functional HOWTO
* bpo-30538: Update enumerate() arguments in Functional HOWTO
(cherry picked from commit 9be4ff3)
Commits on Jun 06, 2017
Also weakens the 'should this be run?' regex to allow all builds when .travis.yml changes.
(cherry picked from commit c53b13b)
(cherry picked from commit 167e0fc)
Clarify that `two-pass` buffer can only be dumped once, and it prints out all text sent to it during all processing, even from Clinic blocks *after* the dumping point.
Commits on Jun 08, 2017
* Update config.{guess,sub} from gnu.org..
(cherry picked from commit 6f46683)
If pass a server_hostname= that fails IDNA decoding to SSLContext.wrap_socket or SSLContext.wrap_bio, then the SSLContext object had a spurious Py_DECREF called on it, eventually leading to segfaults.
(cherry picked from commit 65ece7c)
…2000)

* Fix bpo-30584

* Adding a comment mentionning the bpo and explaining what is the identifier

* Add Denis Osipov to Misc/ACKS
(cherry picked from commit 897bba7)
On Windows, subprocess.Popen.communicate() now also ignore EINVAL
on stdin.write() if the child process is still running but closed the
pipe.
(cherry picked from commit d52aa31)
Commits on Jun 09, 2017
(cherry picked from commit 824f687)
Avoid a deadlock when the waiter who is about to take the lock is
cancelled

Issue #27585
Commits on Jun 10, 2017
…H-2053)

This will allow for centralized management of the Codecov config to prevent skew as well as easier management going forward.

Closes python/core-workflowGH-81.
(cherry picked from commit 11ffb45)
…es (GH-1536) (GH-2056)

Document that assertNotRegexpMatches is a deprecated alias for assertNotRegex.
(cherry picked from commit 74921ed)
(cherry picked from commit 42e3acd)
(cherry picked from commit 34792d2)
…e with certain servers (GH-409) (#2063)

* bpo-29406: asyncio SSL contexts leak sockets after calling close with certain servers (#409)

(cherry picked from commit a608d2d)

* [3.5] bpo-29406: asyncio SSL contexts leak sockets after calling close with certain servers (GH-409)

* asyncio SSL contexts leak sockets after calling close with certain servers

* cleanup _shutdown_timeout_handle on _fatal_error.
(cherry picked from commit a608d2d)
…H-2066)

Mention that fnmatchcase does not call normcase, and fnmatch does.
(cherry picked from commit e5f6e86)
Also updates checked-in line endings on some files.
This PR contains two updates to typing module:

- Support ContextManager on all versions (original PR by Jelle Zijlstra).
- Add generic AsyncContextManager..
(cherry picked from commit 29fda8d)
Commits on Jun 11, 2017
…ing close with certain servers (GH-409) (#2063)" (#2113)

This reverts commit 1395c58.
…2080) (GH-2093)

(cherry picked from commit 0afbabe)

Also fixes some line endings missed in GH-840 backport.
Commits on Jun 12, 2017
import json before using json module
(cherry picked from commit 1dbce04)
…H-2034) (#2122)

The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
(cherry picked from commit 3fd54d4)
Commits on Jun 13, 2017
Move up the discussion about 'with' keyword, so it appears earlier in the document.
(cherry picked from commit bd4e9e0)
(cherry picked from commit d79c1d4)
Add a test to check the current MAGIC_NUMBER against the
expected number for the release if the current release is
at candidate or final level. On test failure, describe to
the developer the procedure for changing the magic number.

This ensures that pre-merge CI will automatically pick up
on magic number changes in maintenance releases (and
explain why those are problematic), rather than relying on
all core developers to be aware of the implications of
such changes.
…2159) (#2167)

* bpo-24484: Avoid race condition in multiprocessing cleanup

The finalizer registry can be mutated while inspected by multiprocessing
at process exit.

* Use test.support.start_threads()

* Add Misc/NEWS.
(cherry picked from commit 1eb6c00)
Commits on Jun 14, 2017
Replace platform with platforms.
(cherry picked from commit 4ebf03d)
The public cyrus.andrew.cmu.edu IMAP server (port 993) doesn't accept
TLS connection using our self-signed x509 certificate. Remove the two
tests which are already skipped.
Commits on Jun 15, 2017
* bpo-29591: Upgrade Modules/expat to libexpat 2.2

* bpo-29591: Restore Python changes on expat

* bpo-29591: Remove expat config of unsupported platforms

Remove the configuration (Modules/expat/*config.h) of unsupported
platforms:

* Amiga
* MacOS Classic on PPC32
* Open Watcom

* bpo-29591: Remove useless XML_HAS_SET_HASH_SALT

The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became
useless since our local expat copy was upgrade to expat 2.1 (it's now
expat 2.2.0).

(cherry picked from commit 23ec4b5)
…4 and v6. (GH-879) (#2218)

the original logic was just comparing the network address
but this is wrong because if the network address is equal then
we need to compare the ip address for breaking the tie

add more ip_interface comparison tests.
(cherry picked from commit 7bd8d3e)
…2222)

In rare circumstances PyImport_Import() could return NULL without raising
an error.
(cherry picked from commit 145541c)
* Rewrite code to pass slaveargs from the master process to worker
  processes: reuse the same code of the Python master branch
* Move code to initialize tests in a new setup_tests() function,
  similar change was done in the master branch
* In a worker process, call setup_tests() with the namespace built
  from slaveargs to initialize correctly tests

Before this change, warm_caches() was not called in worker processes
because the setup was done before rebuilding the namespace from
slaveargs. As a consequence, the huntrleaks feature was unstable. For
example, test_zipfile reported randomly false positive on reference
leaks.
(cherry picked from commit 258bfc4)
bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
reference cycle to not keep objects alive longer than expected.
(cherry picked from commit bbd3cf8)
Commits on Jun 16, 2017
…H-2231)

`PyModule_New()` now refers to `PyModule_NewObject()`
(cherry picked from commit 2d0afef)
…icy (GH-595) (GH-2234)

If max_line_length=None is specified while using the Compat32 policy,
it is no longer ignored..
(cherry picked from commit b459f74)
…to regrtest (#2250)

* bpo-30540: regrtest: add --matchfile option

* Add a new option taking a filename to get a list of test names to
  filter tests.
* support.match_tests becomes a list.
* Modify run_unittest() to accept to match the whole test identifier,
  not just a part of a test identifier.

For example, the following command only runs test_access()
of the FileTests class of test_os:

$ ./python -m test -v -m test.test_os.FileTests.test_access test_os

* bpo-30523: regrtest: Add --list-cases option

* Add --list-cases option to regrtest
* Add get_abs_module() function, use it in list_cases()
* Add ns mandatory positional argument to runtest()
  and runtest_inner()
* Add file optional parameter to printlist()

Co-Authored-By: Louie Lu <[email protected]>
Commits on Jun 19, 2017
…m master to 3.5 (#2279)

* bpo-30383: regrtest: prepend testdir to sys.path

* bpo-30383: Backport test_regrtest

* regrtest: rename --slow option to --slowest

The old --slow syntax is still accepted.

* regrtest: add a single oneliner summary

Example: "Tests result: SUCCESS"

* test_regrtest: add test_coverage()

regrtest now also displays the number of successful tests when
coverage is used.

* test_regrtest: add test_crashed()

Handle correctly crashing test: account the crash has a failed test,
but continue to run other tests.

* regrtest: backport --list-tests feature

* regrtest: backport --fromfile enhancements

* regrtest: backport displaying progress enhancements

* test_regrtest: backport test_randseed()

* regrtest: Fix --coverage on Windows

Don't ignore any directory anymore. Change backported from master.
…n vcvarsall.bat (#2252) (#2281)

* Fixes build scripts to find msbuild.exe and stop relying on vcvarsall.bat
Also fixes bdist_wininst.vcxproj to use correct version in generated name.
Commits on Jun 20, 2017
…) (#2272)

* [3.5] bpo-29887: Test normalization now fails if download fails (GH-905)

* test_normalization fails if download fails

bpo-29887. The test is still skipped if "-u urlfetch" option is not
passed to regrtest (python3 -m test -u urlfetch test_normalization).

* Fix ResourceWarning in test_normalization

bpo-29887: Fix ResourceWarning in test_normalization if tests are
interrupted by CTRL+c.
(cherry picked from commit 722a3af)

* bpo-29887: test_normalization handles PermissionError (#1196)

Skip test_normalization.test_main() if download raises a permission
error.
(cherry picked from commit d13d547)

* no f-strings :(
… (#2290)

The current regex based splitting produces a wrong result. For example::

  http://abc#@def

Web browsers parse that URL as ``http://abc/#@def``, that is, the host
is ``abc``, the path is ``/``, and the fragment is ``#@def``.
(cherry picked from commit 90e01e5)
splithost() expects an URL starting with "//" not with "http://".
…ext module. (GH-2266) (#2298)

They now always return bytes.

Updated the gettext documentation.
(cherry picked from commit 26cb465)
Commits on Jun 21, 2017
New file: Modules/expat/siphash.h.
(cherry picked from commit 5ff7132)
Commits on Jun 22, 2017
CPython workflow is changing!  We're going to start using "blurb"
to manage Misc/NEWS entries:
    https://github.com/python/core-workflow
(This will be a big win for release managers, honest.)

This checkin simply populates the "Misc/NEWS.d" subdirectory tree
so that people can start putting their news entries in there.
No other changes (yet).
Commits on Jun 23, 2017
When a class and its subclass are present, the latter is skipped.
(cherry picked from commit 6580c19)
… (GH-2341)

(cherry picked from commit b066edf)
… (#2350)

* bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348)

bpo-30726, bpo-29591: libexpat 2.2.1 of Modules/expat/ now uses
a winconfig.h configuration file which already defines:

* XML_NS
* XML_DTD
* BYTEORDER=1234
* XML_CONTEXT_BYTES=1024
* HAVE_MEMMOVE

Remove these defines from PCbuild/_elementtree.vcxproj to prevent
compiler warnings.

Co-Authored-By: Jeremy Kloth <[email protected]>
(cherry picked from commit c8fb58b)

* bpo-30726: Fix elementtree warnings on Windows due to expat upgrade (#2319)

* bpo-30726: Fix elementtree warnings on Windows

Caused by usage of `getenv` which should be safe. And a few integer
truncations which should also be ok.

* bpo-30726: Don't ignore libexpat warnings which haypo intends to fix upstream

(cherry picked from commit 87c6555)
…s on Windows. (GH-2325) (#2361)

Prevent passing other invalid environment variables and command arguments..
(cherry picked from commit d174d24)
…ge() (GH-2268) (GH-2365)

Bug didn't manifest itself when importing a module with source as .py files are always the first on the search path. The issue only showed up in bytecode-only packages where the calculated file path would be ``__init__.py/__init__.pyc``.

Patch by Alexandru Ardelean.
(cherry picked from commit c38e32a)
Commits on Jun 24, 2017
defiend -> defined
(cherry picked from commit cab4692)
Commits on Jun 25, 2017
… names (GH-2382) (#2392)

in `os.putenv()` and `os.spawn*()`..
(cherry picked from commit 7770394)
Commits on Jun 26, 2017
bpo-30764, bpo-29335: test_child_terminated_in_stopped_state() of
test_subprocess now uses support.SuppressCrashReport() to prevent the
creation of a core dump on FreeBSD.
(cherry picked from commit cdee3f1)
… not to (GH-2403) (#2419)

* bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to lock

This is especially important if PyThread_acquire_lock() is called reentrantly
(for example from a signal handler).

* Update 2017-06-26-14-29-50.bpo-30765.Q5iBmf.rst

* Avoid core logic when taking the mutex failed.
(cherry picked from commit f84ac42)
Commits on Jun 27, 2017
* bpo-30523: regrtest --list-cases --match (#2401)

* regrtest --list-cases now supports --match and --match-file options.
  Example: ./python -m test --list-cases -m FileTests test_os
* --list-cases now also sets support.verbose to False to prevent
  messages to stdout when loading test modules.
* Add support._match_test() private function.
(cherry picked from commit ace56d5)

* bpo-30764: regrtest: add --fail-env-changed option (#2402)

* bpo-30764: regrtest: change exit code on failure

* Exit code 2 if failed tests ("bad")
* Exit code 3 if interrupted

* bpo-30764: regrtest: add --fail-env-changed option

If the option is set, mark a test as failed if it alters the
environment, for example if it creates a file without removing it.

(cherry picked from commit 63f54c6)

* bpo-30776: reduce regrtest -R false positives (#2422)

* Change the regrtest --huntrleaks checker to decide if a test file
  leaks or not. Require that each run leaks at least 1 reference.
* Warmup runs are now completely ignored: ignored in the checker test
  and not used anymore to compute the sum.
* Add an unit test for a reference leak.

Example of reference differences previously considered a failure
(leak) and now considered as success (success, no leak):

    [3, 0, 0]
    [0, 1, 0]
    [8, -8, 1]
(cherry picked from commit 48b5c42)
…ng(). (GH-2285) (GH-2443)  (#2448)

And use it instead of PyUnicode_AsWideCharString() if appropriate.

_PyUnicode_AsWideCharString(unicode) is like PyUnicode_AsWideCharString(unicode, NULL), but
raises a ValueError if the wchar_t* string contains null characters.
(cherry picked from commit e613e6a).
(cherry picked from commit 0edffa3)
Commits on Jun 28, 2017
Clarify that the break statement breaks out of the innermost enclosing for or while loop.
(cherry picked from commit 36fc896)
…H-2302) (#2463)

Based on patch by Victor Stinner.

Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters..
(cherry picked from commit f7eae0a)
Forgetting to call Process.join() can keep some resources alive.
(cherry picked from commit a79f8fa)
…H-2470) (#2472)

* Clear potential ref cycle between Process and Process target

Besides Process.join() not being called, this was an indirect cause of bpo-30775.
The threading module already does this.

* Add issue reference.
(cherry picked from commit 79d37ae)
Commits on Jun 30, 2017
…H-2493) (#2498)

* bpo-30807: signal.setitimer() may disable the timer by mistake

* Add NEWS blurb
(cherry picked from commit 729780a)
bpo-11798, bpo-16662, bpo-16935, bpo-30813: Skip
test_discover_with_module_that_raises_SkipTest_on_import() and
test_discover_with_init_module_that_raises_SkipTest_on_import() of
test_unittest when hunting reference leaks using regrtest.
(cherry picked from commit e4f9a2d)
* bpo-30280: asyncio now cleans up threads

asyncio base TestCase now uses threading_setup() and
threading_cleanup() of test.support to cleanup threads.

* asyncio: Fix TestBaseSelectorEventLoop cleanup

bpo-30280: TestBaseSelectorEventLoop of
test.test_asyncio.test_selector_events now correctly closes the event
loop: cleanup its executor to not leak threads.

Don't override the close() method of the event loop, only override
the_close_self_pipe() method.

(cherry picked from commit b903067)
Commits on Jul 02, 2017
GH-2533)

Improve the description of the high and low parameters for set_write_buffer_limits.
Also fixed a small grammatical issue.
(cherry picked from commit 5200a7c)
Commits on Jul 03, 2017
… from 3.6 to 3.5 (#2540)

* [3.6] bpo-29512, bpo-30776: Backport regrtest enhancements from master to 3.6 (#2513)

* bpo-29512: Add test.bisect, bisect failing tests (#2452)

Add a new "python3 -m test.bisect" tool to bisect failing tests.

It can be used to find which test method(s) leak references, leak
files, etc.
(cherry picked from commit 84d9d14)

* bpo-30776: regrtest: reduce memleak false positive (#2484)

Only report a leak if each run leaks at least one memory block.
(cherry picked from commit beeca6e)

(cherry picked from commit a3ca94d)

* bpo-30764: Fix regrtest --fail-env-changed --forever (#2536) (#2539)

--forever now stops if a fail changes the environment.
(cherry picked from commit 5e87592)
(cherry picked from commit 4132adb)
Commits on Jul 04, 2017
…er it (GH-2409). (#2557)

(cherry picked from commit 8a8d285)
FXpy doesn't have a Python 3 port and it only
supports Python 2.2 and older versions.

Reported by Alex Walters on [email protected].

(cherry picked from commit d3ed287)
(cherry picked from commit 7526cad)
Commits on Jul 05, 2017
* bpo-30855: Trying to fix test_use on Windows.

Avoid possible weird behavior of WideInt convertion.
"winfo id" always returns string hexadecimal representation.

(cherry picked from commit b9d6724)

* bpo-30855: Trying to fix test_use on Windows.

(cherry picked from commit 29a2f7c)
Commits on Jul 06, 2017
(cherry picked from commit 76c567e)
(cherry picked from commit be5ebe5)
Leading whitespace was incorrectly dropped during folding of certain lines in the _header_value_parser's folding algorithm.  This makes the whitespace handling code consistent.
Commits on Jul 09, 2017
If history-length is set in .inputrc, and the history file is double the
history size (or more), history_get(N) returns NULL, and python
segfaults. Fix that by checking for NULL return value.

It seems that the root cause is incorrect handling of bigger history in
readline, but Python should not segfault even if readline returns
unexpected value.

This issue affects only GNU readline. When using libedit emulation
system history size option does not work.
Commits on Jul 10, 2017
multiprocessing.Queue.join_thread() now waits until the thread
completes, even if the thread was started by the same process which
created the queue.

Fix the following warning which occurs randomly when running
test_handle_called_with_mp_queue of test_logging.QueueListenerTest:

Warning -- threading_cleanup() failed to cleanup -1 threads after 4 sec (count: 0, dangling: 1)
(cherry picked from commit 3b69d91)
Handle getattr(copy, 'deepcopy') error in _elementtree module
initialization.
(cherry picked from commit b136f11)
Commits on Jul 11, 2017
…hen (GH-2634) (#2657)

called with bytes-like argument.
(cherry picked from commit 1180e5a)
…object.c. (GH-2623) (#2659)

Based on patch by Victor Stinner.
(cherry picked from commit 64e461b)
Commits on Jul 13, 2017
…json (GH-2690) (#2693)

encoder and decoder.
(cherry picked from commit d3aaa2f)
Commits on Jul 15, 2017
Commits on Jul 16, 2017
Commits on Jul 18, 2017
Commits on Jul 20, 2017
When running the test suite using --use=all / -u all, exclude tzdata
since it makes test_datetime too slow (15-20 min on some buildbots)
which then times out on some buildbots.

-u tzdata must now be enabled explicitly, -u tzdata or -u all,tzdata,
to run all test_datetime tests.

Fix also regrtest command line parser to allow passing -u
extralargefile to run test_zipfile64.

Travis CI: remove -tzdata. Replace -u all,-tzdata,-cpu with -u all,-cpu since tzdata is now excluded from -u all.
(cherry picked from commit 5b392bb)
* Oops, tzdata was introduced in Python 3.6: remove it from regrtest
* Remove also Lib/test/libregrtest/__init__.py file: add by mistake
  on a backport.
Commits on Jul 21, 2017
…builtin functions (GH-3)

Cython will, in the right circumstances, offer a MethodType instance
where im_func is a builtin function. Any instance of MethodType is
automatically assumed to be a Python-defined function (more
specifically, a function that has an inspectable signature), but
_set_signature was still conservative in its assumptions. As a result
_set_signature would return early with None instead of a mock since
the im_func had no inspectable signature. This causes problems
deeper inside mock, as _set_signature is assumed to _always_
return a mock, and nothing checked its return value.

In similar corner cases, autospec will simply not check the spec of the
function, so _set_signature is amended to now return early with the
original, not-wrapped mock object.

Patch by Aaron Gallagher.

(cherry picked from commit 856cbcc)
Commits on Jul 23, 2017
* bpo-30876: Relative import from unloaded package now reimports the package
instead of failing with SystemError.

Relative import from non-package now fails with ImportError rather than
SystemError.
(cherry picked from commit 8a9cd20)

* bpo-18018: Import raises ImportError instead of SystemError if a relative
import is attempted without a known parent package.

* bpo-26367: importlib.__init__() raises ImportError like
builtins.__import__() when ``level`` is specified but without an accompanying
package specified.
(cherry picked from commit 4da5224)
(cherry picked from commit 4c7532e)
Commits on Jul 24, 2017
tearDown() now clears explicitly the self.server variable to make
sure that the thread is completely cleared when tearDownClass()
checks if all threads have been cleaned up.

Fix the following warning:

$ ./python -m test --fail-env-changed -m test.test_os.TestSendfile.test_keywords -R 3:1 test_os
(...)
Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 2)
(...)
Tests result: ENV CHANGED
(cherry picked from commit d1cc037)
Commits on Jul 26, 2017
Commits on Jul 27, 2017
…blurb (#2874)

* bpo-31036: use an existing Misc/NEWS rather than trying to use blurb

* bpo-31036: avoid echoing comments
Commits on Jul 29, 2017
Commits on Aug 01, 2017
Use the copy provided in https://bugs.python.org/issue25910GH-msg295200
(cherry picked from commit 8474d87)
(cherry picked from commit e1e60bd)
Commits on Aug 07, 2017
…blurb (#2874)

* bpo-31036: use an existing Misc/NEWS rather than trying to use blurb

* bpo-31036: avoid echoing comments

(cherry picked from commit 3de1448)
Use the copy provided in https://bugs.python.org/issue25910GH-msg295200
(cherry picked from commit 8474d87)
(cherry picked from commit f6306e7)
Commits on Sep 08, 2017
…-3440)

Rather than requiring the path to blurb and/or sphinx-build to be specified to
the make rule, enhance the Doc/Makefile to look for each first in a virtual
environment created by make venv and, if not found, look on the normal process
PATH. This allows the Doc/Makefile to take advantage of an installed
spinx-build or blurb and, thus, do the right thing most of the time. Also, make
the directory for the venv be configurable and document the `make venv` target.
…#3126)

The `Show Source` was broken because of a change made in sphinx 1.5.1
In Sphinx 1.4.9, the sourcename was "index.txt".
In Sphinx 1.5.1+, it is now "index.rst.txt".
(cherry picked from commit b9ff498)
Commits on Sep 24, 2017
Works around Travis CI bug about the python3.5 binary:
travis-ci/travis-ci#8363
Commits on Sep 25, 2017
#3354)

* bpo-30947, bpo-31170: Update expat from 2.2.1 to 2.2.4

* Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to get security
  fixes.

* Update libexpat from 2.2.3 to 2.2.4. Fix copying of partial
  characters for UTF-8 input (libexpat bug 115):
  libexpat/libexpat#115

* Define XML_POOR_ENTROPY when compiling expat
Commits on Sep 26, 2017
…3751)

* bpo-31170: Fix inclusion of expat in Windows build projects.

* Fixes line endings
(cherry picked from commit a6296d3)
Commits on Oct 04, 2017
Commits on Oct 12, 2017
Commits on Dec 08, 2017
2 authors and larryhastings
Fixes possible integer overflow in PyBytes_DecodeEscape.

Co-Authored-By: Jay Bosamiya <[email protected]>
Commits on Jan 23, 2018
* [3.5] Remove failing pyenv call from CI config

* Backport XML RPC test skip to 3.5

The buildbot service upgrade removed the XML-RPC
interface, so this test no longer works (through no
fault of the standard library).
* [3.5] bpo-32563: Get expat to compile under C89

expat: Add artificial scopes in xmltok.c utf8_toUtf8() to fix c89 compilation.

Cherry-picked from libexpat commit e0b290eb3d8f4c4b45137a7d7f4f8db812145bd2

* Backport XML RPC test skip to 3.5

The buildbot service upgrade removed the XML-RPC
interface, so this test no longer works (through no
fault of the standard library).

* Don't configure a nonexistent Python
Directory and zipfile execution previously added
the parent directory of the directory or zipfile
as sys.path[0] and then subsequently overwrote
it with the directory or zipfile itself.

This caused problems in isolated mode, as it
overwrote the "stdlib as a zip archive" entry
in sys.path, as the parent directory was
never added.

The attempted fix to that issue in bpo-29319
created the opposite problem in *non*-isolated
mode, by potentially leaving the parent
directory on sys.path instead of overwriting it.

This change fixes the root cause of the problem
by removing the whole "add-and-overwrite" dance
for sys.path[0], and instead simply never adds
the parent directory to sys.path in the first
place.

(cherry picked from commit d2977a3)
* [3.5] bpo-32072: Fix issues with binary plists. (GH-4455)

* Fixed saving bytearrays.
* Identical objects will be saved only once.
* Equal references will be load as identical objects.
* Added support for saving and loading recursive data structures.
(cherry picked from commit a897aee)

* Fix implementation dependent assertion in test_plistlib. (#4813)

It is failed with an advanced optimizer.
Commits on Feb 01, 2018
Commits on Feb 05, 2018
Commits on Mar 11, 2018
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters <[email protected]>
Co-authored-by: Christian Heimes <[email protected]>.
(cherry picked from commit 0e6c8ee)
Commits on May 14, 2018
* bpo-33001: Minimal fix to prevent buffer overrun in os.symlink

* Remove invalid test
Commits on Jun 27, 2018
Commits on Jul 19, 2018
Clarify the documentation for the CALL_FUNCTION_* bytecodes.  They changed in 3.5 in subtle ways and the documentation has never been correct, much less clear.
Commits on Feb 25, 2019
* bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)

The C accelerated _elementtree module now initializes hash randomization
salt from _Py_HashSecret instead of libexpat's default CPRNG.

Signed-off-by: Christian Heimes <[email protected]>

https://bugs.python.org/issue34623
(cherry picked from commit cb5778f)

Co-authored-by: Christian Heimes <[email protected]>
…1874)

On Travis CI, FTP tests of test_urllib2net randomly fail with "425
Security: Bad IP connecting".

(cherry picked from commit c11b3b1)
Commits on Feb 26, 2019
Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL
distribution points with empty DP or URI correctly. A malicious or buggy
certificate can result into segfault.

Vulnerability (TALOS-2018-0758) reported by Colin Read and Nicolas
Edet of Cisco.

Signed-off-by: Christian Heimes <[email protected]>

(cherry picked from commit a37f524)
The xml.sax and xml.dom.domreg modules now obey
sys.flags.ignore_environment.

Signed-off-by: Christian Heimes <[email protected]>

(cherry picked from commit 223e501)
Commits on Mar 01, 2019
…0994)

* bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210)

LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
LibreSSL < 2.7.

Documentation updates and fixes for failing tests will be provided in
another patch set.

Signed-off-by: Christian Heimes <[email protected]>
Commits on Mar 04, 2019
) (#12144)

Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some
reserved signal numbers between 1 and NSIG.  The `range(1, NSIG)` idiom
is commonly used to select all signals for blocking with `pthread_sigmask`.
So we ignore the sigaddset() return value until we expose sigfillset()
to provide a better idiom.
(cherry picked from commit 25038ec)

Co-authored-by: Antoine Pitrou <[email protected]>
Commits on Mar 16, 2019
* Refactor cookie path check as per RFC 6265

* Add tests for prefix match of path

* Add news entry

* Fix set_ok_path and refactor tests

* Use slice for last letter

(cherry picked from commit 0e1f1f0)
Commits on Mar 17, 2019
…GH-10258) (#12281)

Don't send cookies of domain A without Domain attribute to domain B when domain A is a suffix match of domain B while using a cookiejar with `http.cookiejar.DefaultCookiePolicy` policy.  Patch by Karthikeyan Singaravelan.
(cherry picked from commit ca7fe50)

Co-authored-by: Xtreak <[email protected]>
Commits on Mar 19, 2019
Commits on Jul 13, 2019
* [3.5] Doc: Add an optional obsolete header. (GH-13638).
(cherry picked from commit 46ed90d)

Co-authored-by: Julien Palard <[email protected]>
#13200)

* [3.5] bpo-36816: Update the self-signed.pythontest.net cert (GH-13192)

We updated the server, our testsuite must match.

https://bugs.python.org/issue36816

✈️ CLE -> DEN ✈️ GH-pycon2019
(cherry picked from commit 6bd8173)

Co-authored-by: Gregory P. Smith <[email protected]>
… use C89 for loops in backported pickle patch (#12622)
Commits on Jul 14, 2019
…) (GH-13505) (#13510)

CVE-2019-9948: Avoid file reading by disallowing local-file:// and
local_file:// URL schemes in URLopener().open() and
URLopener().retrieve() of urllib.request.

Co-Authored-By: SH <[email protected]>
Disallow control chars in http URLs in urllib.urlopen.  This addresses a potential security problem for applications that do not sanity check their URLs where http request headers could be injected.

Disable https related urllib tests on a build without ssl (GH-13032)
These tests require an SSL enabled build. Skip these tests when python is built without SSL to fix test failures.

Use http.client.InvalidURL instead of ValueError as the new error case's exception. (GH-13044)

Co-Authored-By: Miro Hrončok <[email protected]>
Commits on Sep 07, 2019
…1.1.1 (#12694)

Some test_ssl and test_asyncio tests were written for OpenSSL 1.0 and TLS 1.0, but fail with OpenSSL 1.1.1 and TLS 1.3.  Fixing these requires backporting new ssl flags like ssl.OP_NO_TLSv1_3 or ssl.OP_NO_COMPRESSION, which is inappropriate at this stage in Python 3.5's lifetime. Moreover, it's not really worth it: the code works fine, the problem is just in the tests.  This patch disables those problematic tests when Python 3.5 is built using newer versions of OpenSSL.
… (GH-13814) (#14772)

(cherry picked from commit 8d0ef0b)

Co-authored-by: Steve Dower <[email protected]>
(cherry picked from commit fd1771d)
…ail headers (GH-14794) (#15446)

* [3.5] bpo-37461: Fix infinite loop in parsing of specially crafted email headers (GH-14794)

Some crafted email header would cause the get_parameter method to run in an
infinite loop causing a DoS attack surface when parsing those headers. This
patch fixes that by making sure the DQUOTE character is handled to prevent
going into an infinite loop.
(cherry picked from commit a4a994b)

Co-authored-by: Abhilash Raj <[email protected]>
Co-Authored-By: Ashwin Ramaswami <[email protected]>
Commits on Oct 08, 2019
(cherry picked from commit 2db96ae)

Co-authored-by: Julien Palard <[email protected]>
(cherry picked from commit 23a98ab)
…alidation and encoding behavior (GH-16448) (#16475)

* [3.5] bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448)
Showing 543 changed files with 63,592 additions and 23,602 deletions.
@@ -0,0 +1,41 @@
# Binary data types
*.aif binary
*.aifc binary
*.aiff binary
*.au binary
*.bmp binary
*.exe binary
*.icns binary
*.gif binary
*.ico binary
*.jpg binary
*.pck binary
*.png binary
*.psd binary
*.tar binary
*.wav binary
*.whl binary
*.zip binary

# Specific binary files
Lib/test/sndhdrdata/sndhdr.* binary

# Text files that should not be subject to eol conversion
Lib/test/cjkencodings/* -text
Lib/test/decimaltestdata/*.decTest -text
Lib/test/test_email/data/*.txt -text
Lib/test/xmltestdata/* -text
Lib/test/coding20731.py -text

# Special files in third party code
Modules/zlib/zlib.map -text

# CRLF files
*.bat text eol=crlf
*.ps1 text eol=crlf
*.sln text eol=crlf
*.vcxproj* text eol=crlf
*.props text eol=crlf
*.proj text eol=crlf
PCbuild/readme.txt text eol=crlf
PC/readme.txt text eol=crlf
@@ -0,0 +1,28 @@
version: 3.5.3+.{build}
clone_depth: 5
branches:
only:
- master
- /\d\.\d/
- buildbot-custom
build_script:
- cmd: PCbuild\build.bat -e
test_script:
- cmd: PCbuild\rt.bat -q -uall -u-cpu -rwW --timeout=1200 -j0

# Only trigger AppVeyor if actual code or its configuration changes
only_commits:
files:
- .github/appveyor.yml
- .gitattributes
- Grammar/
- Include/
- Lib/
- Modules/
- Objects/
- PC/
- PCBuild/
- Parser/
- Programs/
- Python/
- Tools/
@@ -0,0 +1,36 @@
codecov:
strict_yaml_branch: master
notify:
require_ci_to_pass: true
comment: off
ignore:
- "Doc/**/*"
- "Misc/*"
- "Mac/**/*"
- "PC/**/*"
- "PCbuild/**/*"
- "Tools/**/*"
- "Grammar/*"
coverage:
precision: 2
range:
- 70.0
- 100.0
round: down
status:
changes: off
project: off
patch:
default:
target: 100%
only_pulls: true
threshold: 0.05
parsers:
gcov:
branch_detection:
conditional: true
loop: true
macro: false
method: false
javascript:
enable_partials: false
@@ -53,10 +53,12 @@ PCbuild/*.suo
PCbuild/*.*sdf
PCbuild/*-pgi
PCbuild/*-pgo
PCbuild/*.VC.db
PCbuild/*.VC.opendb
PCbuild/.vs/
PCbuild/amd64/
PCbuild/obj/
PCBuild/win32/
PCbuild/win32/
.purify
Parser/pgen
__pycache__

This file was deleted.

@@ -0,0 +1,110 @@
language: c
dist: trusty
sudo: false
group: beta

# To cache doc-building dependencies.
cache: pip

branches:
only:
- master
- /^\d\.\d$/

matrix:
fast_finish: true
allow_failures:
- env: OPTIONAL=true
include:
- os: linux
language: c
compiler: clang
# gcc also works, but to keep the # of concurrent builds down, we use one C
# compiler here and the other to run the coverage build. Clang is preferred
# in this instance for its better error messages.
env: TESTING=cpython
- os: osx
language: c
compiler: clang
# Testing under macOS is optional until testing stability has been demonstrated.
env: OPTIONAL=true
before_install:
- brew install openssl xz
- export CPPFLAGS="-I$(brew --prefix openssl)/include"
- export LDFLAGS="-L$(brew --prefix openssl)/lib"
- os: linux
language: python
python: 3.6
env: TESTING=docs
before_script:
- cd Doc
# Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
# (Updating the version is fine as long as no warnings are raised by doing so.)
- python -m pip install sphinx==1.8.2 blurb
script:
- make check suspicious html SPHINXOPTS="-q -W -j4"
- os: linux
language: c
compiler: gcc
env: OPTIONAL=true
before_script:
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
then
echo "Only docs were updated, stopping build process."
exit
fi
./configure
make -s -j4
# Need a venv that can parse covered code.
./python -m venv venv
./venv/bin/python -m pip install -U coverage
script:
# Skip tests that re-run the entire test suite.
- ./venv/bin/python -m coverage run --pylib -m test -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn
after_script: # Probably should be after_success once test suite updated to run under coverage.py.
# Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
- source ./venv/bin/activate
- bash <(curl -s https://codecov.io/bash)

# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
before_script:
- |
set -e
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
then
echo "Only docs were updated, stopping build process."
exit
fi
./configure --with-pydebug
make -j4
make -j4 regen-all clinic
changes=`git status --porcelain`
if ! test -z "$changes"
then
echo "Generated files not up to date"
echo "$changes"
exit 1
fi
script:
# Using the built Python as patchcheck.py is built around the idea of using
# a checkout-build of CPython to know things like what base branch the changes
# should be compared against.
# Only run on Linux as the check only needs to be run once.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
# `-r -w` implicitly provided through `make buildbottest`.
- make buildbottest TESTOPTS="-j4 -uall,-cpu"

notifications:
email: false
irc:
channels:
# This is set to a secure variable to prevent forks from notifying the
# IRC channel whenever they fail a build. This can be removed when travis
# implements https://github.com/travis-ci/travis-ci/issues/1094.
# The actual value here is: irc.freenode.net#python-dev
- secure: "s7kAkpcom2yUJ8XqyjFI0obJmhAGrn1xmoivdaPdgBIA++X47TBp1x4pgDsbEsoalef7bEwa4l07KdT4qa+DOd/c4QxaWom7fbN3BuLVsZuVfODnl79+gYq/TAbGfyH+yDs18DXrUfPgwD7C5aW32ugsqAOd4iWzfGJQ5OrOZzqzGjYdYQUEkJFXgxDEIb4aHvxNDWGO3Po9uKISrhb5saQ0l776yLo1Ur7M4oxl8RTbCdgX0vf5TzPg52BgvZpOgt3DHOUYPeiJLKNjAE6ibg0U95sEvMfHX77nz4aFY4/3UI6FFaRla34rZ+mYKrn0TdxOhera1QOgPmM6HzdO4K44FpfK1DS0Xxk9U9/uApq+cG0bU3W+cVUHDBe5+90lpRBAXHeHCgT7TI8gec614aiT8lEr3+yH8OBRYGzkjNK8E2LJZ/SxnVxDe7aLF6AWcoWLfS6/ziAIBFQ5Nc4U72CT8fGVSkl8ywPiRlvixKdvTODMSZo0jMqlfZSNaAPTsNRx4wu5Uis4qekwe32Fz4aB6KGpsuuVjBi+H6v0RKxNJNGY3JKDiEH2TK0UE2auJ5GvLW48aUVFcQMB7euCWYXlSWVRHh3WLU8QXF29Dw4JduRZqUpOdRgMHU79UHRq+mkE0jAS/nBcS6CvsmxCpTSrfVYuMOu32yt18QQoTyU="
on_success: change
on_failure: always
skip_join: true
@@ -4,13 +4,15 @@
#

# You can set these variables from the command line.
PYTHON = python
SPHINXBUILD = sphinx-build
PYTHON = python3
VENVDIR = ./venv
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
PAPER =
SOURCES =
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)

ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PAPER) \
$(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)

.PHONY: help build html htmlhelp latex text changes linkcheck \
@@ -38,6 +40,20 @@ help:
@echo " serve to serve the documentation on the localhost (8000)"

build:
-mkdir -p build
# Look first for a Misc/NEWS file (building from a source release tarball
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
# (building from a newer repo) and use blurb to generate the NEWS file.
@if [ -f ../Misc/NEWS ] ; then \
echo "Using existing Misc/NEWS file"; \
cp ../Misc/NEWS build/NEWS; \
elif [ -d ../Misc/NEWS.d ]; then \
echo "Building NEWS from Misc/NEWS.d with blurb"; \
$(BLURB) merge -f build/NEWS; \
else \
echo "Neither Misc/NEWS.d nor Misc/NEWS found; cannot build docs"; \
exit 1; \
fi
$(SPHINXBUILD) $(ALLSPHINXOPTS)
@echo

@@ -103,11 +119,12 @@ htmlview: html
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"

clean:
-rm -rf build/* venv/*
-rm -rf build/* $(VENVDIR)/*

venv:
$(PYTHON) -m venv venv
./venv/bin/python3 -m pip install -U Sphinx
$(PYTHON) -m venv $(VENVDIR)
$(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb
@echo "The venv has been created in the $(VENVDIR) directory"

dist:
rm -rf dist
@@ -153,21 +170,26 @@ dist:
cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub

check:
$(PYTHON) tools/rstlint.py -i tools
$(PYTHON) tools/rstlint.py -i tools -i $(VENVDIR) -i README.rst

serve:
../Tools/scripts/serve.py build/html

# Targets for daily automated doc build
# By default, Sphinx only rebuilds pages where the page content has changed.
# This means it doesn't always pick up changes to preferred link targets, etc
# To ensure such changes are picked up, we build the published docs with
# `-E` (to ignore the cached environment) and `-a` (to ignore already existing
# output files)

# for development releases: always build
autobuild-dev:
make dist SPHINXOPTS='$(SPHINXOPTS) -A daily=1 -A versionswitcher=1'
make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A switcher=1'
-make suspicious

# for quick rebuilds (HTML only)
autobuild-dev-html:
make html SPHINXOPTS='$(SPHINXOPTS) -A daily=1 -A versionswitcher=1'
make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A switcher=1'

# for stable releases: only build if not in pre-release stage (alpha, beta)
# release candidate downloads are okay, since the stable tree can be in that stage
@@ -104,6 +104,15 @@ Then, from the ``Doc`` directory, run ::
where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
see the make targets above).

Deprecation header
==================

You can define the ``outdated`` variable in ``html_context`` to show a
red banner on each page redirecting to the "latest" version.

The link points to the same page on ``/3/``, sadly for the moment the
language is lost during the process.


Contributing
============

No commit comments for this range

You can’t perform that action at this time.