Catch the Windows socket WSAEINVAL error (code 10022) in imaplib
on shutdown(SHUT_RDWR): An invalid operation was attempted
This error occurs sometimes on SSL connections.
(cherry picked from commit 83a2c28798)
* Use explicit numbering for footnotes referred by explicit number.
* Fix literal strings formatting in howto/urllib2.rst.
* Add `:noindex:` to duplicated definition of list.
* Update susp-ignored.csv for reference/expressions.rst.
(cherry picked from commit d97b7dc94b)
* bpo-30357 each test in test_thread waits until all spawn threads finish
* bpo-30357 each test in test_thread waits until all spawn threads finish
* bpo-30357: test_thread now uses threading_cleanup() (#1592)
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: Victor Stinner <victor.stinner@gmail.com>
* bpo-30357: test_thread now uses threading_cleanup() (#1592)
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: Victor Stinner <victor.stinner@gmail.com>
Also backport new functions temp_dir() and python_is_optimized().
temp_cwd() now accepts None as a name (means using tempfile.mkdtemp).
check_syntax_error() now accepts arguments lineno and offset.
Use more specific error messages in get_attribute().
Fix for bpo-6393: Python crashes on OSX when $LANG is set to some (but
not all) invalid values due to an invalid result from nl_langinfo
(cherry picked from commit 6d77e07196)
* bpo-30283: regrtest: backport test_coverage()
* Add --coverage option, the option was already described in the doc
* When coverage is used, regrtest now pass all options to runtest()
and calls also accumulate_result() (as done when coverage is not
used).
* bpo-25260: Fix coverage on Windows: remove the list of ignored
directories.
* bpo-30283: regrtest: backport test_slow_interrupted()
* Fix regrtest to report interrupted tests as omitted rather than
failed.
* bpo-25260: Fix coverage on Windows: remove the list of ignored
directories.
* bpo-30283: Fix test_regrtest on Visual Studio 2008
Skip Tools\buildbot\test.bat and PCbuild\rt.bat if Python was not
compiled in PCbuild (but compiled in PC\VS9.0\ for example).
Try to fix test_startfile's inability to clean up after itself in
time. Patch by Jeremy Kloth.
Fix the following support.rmtree() error while trying to remove the
temporary working directory used by Python tests:
WindowsError: [Error 32] The process cannot access the file because
it is being used by another process: ...
Original commit: 8a53dbeb7a
* bpo-29243: Fix Makefile with respect to --enable-optimizations
When using the Profile Guided Optimization (./configure --enable-optimizations)
Python is built not only during `make` but rebuilt again during `make test`,
`make install` and others. This patch fixes the issue.
Note that this fix produces no change at all in the Makefile if configure is
run witout --enable-optimizations.
* !squash.
(cherry picked from commit a1054c3b00)
* regrtest: add --slowest alias to --slow
* make buildbottest: add --slowest option
* regrtest: add "- " prefix to --slowest output
* regrtest: Fix an outdated comment
* regrtest: replace PermissionError
Replace PermissionError with OSError and check on exc.errno.
PermissionError was added to Python 3.3.
* regrtest: add -3 -tt options to run Python scripts
* regrtest: backport --list-tests option
* regrtest: backport "Tests result: xxx" summary
* regrtest: backport total duration
* regrtest: add timestamp to the progress
* regrtest: describe previous test state
* Add the state of the test: passed, failed, etc.
* If a test took longer than 30 seconds, log its execution time
* regrtest: -jN logs running workers
* regrtest: mention if tests are run in parallel
* regrtest: parallel mode is more verbose during wait
Display running tests every 30 seconds if no test completed in the
meanwhile.
* test_regrtest: fix typo in SubprocessRun
* bpo-30283: regrtest: add --testdir option
* bpo-30283: Backport _testcapi.raise_signal()
Function used by test_regrtest to simulate an interrupted unit test.
* bpo-30283: Backport test_regrtest from master
Fix the following warning when test_inspect.py is compiled to
test_inspect.pyc:
test_inspect.py:505: SyntaxWarning: tuple parameter unpacking has been removed in 3.x
def spam_deref(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h):
Replace also test.test_support import with test.support.
It was possible to get a core dump by using uninitialized
_json objects. Now __new__ methods create initialized objects.
__init__ methods are removed..
(cherry picked from commit 76a3e51a40)
ExpatParser.parse() of xml.sax.xmlreader now closes the source: close
the file object or the urllib object if source is a string (not an
open file-like object).
Add test_parse_close_source() unit test.
Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".
Changes:
* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:
- regen-ast: Include/Python-ast.h and Python/Python-ast.c
- regen-grammar: Include/graminit.h and Python/graminit.c
- regen-opcode-targets: Python/opcode_targets.h
* Add PYTHON_FOR_REGEN variable
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
compilation outside the source directory
Add setUpModule() and tearDownModule() functions to test_site to
save/restore sys.path at the module level to prevent warning if the
user site directory is created, since site.addsitedir() modifies
sys.path.
(cherry picked from commit b85c136903)
DummyFTPServer now calls del_channel() on bind() error to prevent the
following warning in TestIPv6Environment.setUpClass():
Warning -- asyncore.socket_map was modified by test_ftplib
Before: {}
After: {3: <test.test_ftplib.DummyFTPServer 127.0.0.1:0 at ...>}
Use EnvironGuard on BuildExtTestCase to save/restore os.environ, to fix the
following warning:
Warning -- os.environ was modified by test_distutils
MSVCCompiler.initialize() of distutils.msvc9compiler modifies
os.environ.
* Add Appveyor to Python 2.7 branch
* Adapt AppVeyor config for Python 2
* Replace -j0 with -j2: -j0 is ignored on Python 2
* Replace --slowest with --slow
* Remove --timeout option (it was introduced in Python 3)
Backport the CHILD_ERROR status from master: a test is considered as
failed if a worker process running a test exited with a code
different than zero.
Change also the output: write stdout and stderr of the child process
after the test name, instead of writing it before.
accumulate_result(): don't use time of CHILD_ERROR or INTERRUPTED
results.
Use EnvironGuard on InstallTestCase and UtilTestCase.
Backport fixes from master to prevent the following warning:
Warning -- os.environ was modified by test_distutils
In PySlice_IndicesEx, clip the step to [-PY_SSIZE_T_MAX,
PY_SSIZE_T_MAX] rather than [PY_SSIZE_T_MIN, PY_SSIZE_T_MAX].
(cherry picked from commit e6fc7401a9)
Buildbots don't run tests with -vv and so only log "xxx was modified
by test_xxx" which is not enough to debug such random issue. In many
cases, I'm unable to reproduce the warning and so unable to fix it.
Always logging the value before and value after should help to debug
such warning on buildbots.
(cherry picked from commit ec4b17239d)
(cherry picked from commit 2298235023)
AsyncoreEchoServer of test_ssl now calls
asyncore.close_all(ignore_all=True) to ensure that
asyncore.socket_map is cleared once the test completes, even if
ConnectionHandler was not correctly unregistered.
Fix the following warning:
Warning -- asyncore.socket_map was modified by test_ssl
Before: {}
After: {6: <test.test_ssl.AsyncoreEchoServer.EchoServer.ConnectionHandler>}
(cherry picked from commit 1dae7450c6)
Use --short form of git hash. Use output from "git describe" for tag.
Expected outputs:
1. previous hg
2. previous git
3. updated git
Release (tagged) build:
1. Python 3.7.0a0 (v3.7.0a0:4def2a2901a5, ...
2. Python 3.7.0a0 (v3.7.0a0^0:05f53735c8912f8df1077e897f052571e13c3496, ...
3. Python 3.7.0a0 (v3.7.0a0:05f53735c8, ...
Development build:
1. Python 3.7.0a0 (default:41df79263a11, ...
2. Python 3.7.0a0 (master:05f53735c8912f8df1077e897f052571e13c3496, ...
3. Python 3.7.0a0 (heads/master-dirty:05f53735c8, ...
"dirty" means the working tree has uncommitted changes.
See "git help describe" for more info.
(cherry picked from commit 554626ada7)
(cherry picked from commit ed512cba78)
To unify running tests in Python 2.7 and Python 3, the test
package can be run as a script. This is equivalent to running the
test.regrtest module as a script.
Based on commit 5c4b0d063a by Ned
Deily, which is based on original patches by Brett Cannon and Steve
Dower.
Remove also the private _Py_svnversion() function and SVNVERSION
variable.
Note: Py_SubversionRevision() and Py_SubversionShortBranch() are
unchanged, they are part of the public API.