Commit Graph

27352 Commits

Author SHA1 Message Date
bennorth c20c97f612 bpo-18533: Avoid RuntimeError from repr() of recursive dictview (#4823) (#5357)
(cherry picked from commit d7773d92bd)
2018-02-27 00:35:03 +02:00
Miss Islington (bot) 07c13eee79
Delete a broken threading.local example (GH-5870)
This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true.
(cherry picked from commit 5fb632e831)

Co-authored-by: Aaron Gallagher <habnabit@users.noreply.github.com>
2018-02-25 07:34:46 -08:00
Christian Heimes 6e8f395001
bpo-25404: SSLContext.load_dh_params() non-ASCII path (GH-3459)
SSLContext.load_dh_params() now supports non-ASCII path.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-25 09:48:02 +01:00
Christian Heimes 8d4d17399f
bpo-31518: Change TLS protocol for Debian (#3661)
Debian Unstable has disabled TLS 1.0 and 1.1 for SSLv23_METHOD(). Change
TLS/SSL protocol of some tests to PROTOCOL_TLS or PROTOCOL_TLSv1_2 to
make them pass on Debian.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-25 00:45:53 +01:00
Anselm Kruis 61bd4d2e63 [2.7] bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066) (GH-5825)
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup..
(cherry picked from commit 33dddac00b)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>
2018-02-23 08:27:28 -08:00
Miss Islington (bot) b852d8c1f0 [2.7] bpo-31848: Fix broken error handling in Aifc_read.initfp() when the SSND chunk is not found (GH-5240) (GH-5781)
Initialize self._ssnd_chunk so that aifc.Error is raised as intended,
not AttributeError.
(cherry picked from commit 80d20b918b)


Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-02-21 08:37:18 +02:00
Éric Araujo eeb33651bf [2.7] bpo-21060 Improve error message for "setup.py upload" without dist files (GH-5726).
(cherry picked from commit 08a6926b25)

Co-authored-by: Éric Araujo <merwok@netwok.org>
2018-02-18 19:56:06 -08:00
Serhiy Storchaka 17cec70a38
bpo-30109: Fix reindent.py for non-ASCII files. (#5637)
It now processes files as binary streams.

This also fixes "make reindent".
2018-02-12 20:16:42 +02:00
Serhiy Storchaka e7197936c9
[2.7] bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5604)
Co-authored-by: Jake Davis <jcdavis@awedge.net>.
(cherry picked from commit 2411292ba8)
2018-02-10 00:02:04 +02:00
Benjamin Peterson 0a18422b31
allow the test suite to pass if the strop module doesn't exist (GH-5566)
strop is highly legacy and can be safely compiled out in most installations. Let's not fail the test suite for its absence.
2018-02-06 09:29:21 -08:00
Serhiy Storchaka b7a2c17be8
[2.7] bpo-32137: The repr of deeply nested dict now raises a RuntimeError (GH-4570) (#5493)
instead of crashing due to a stack overflow.

This perhaps will fix similar problems in other extension types.
(cherry picked from commit 1fb72d2ad2)
2018-02-02 16:29:02 +02:00
Victor Stinner b60f43a0e6
bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (GH-2148) (GH-5429)
_test_multiprocessing.test_queue_feeder_donot_stop_onexc() now uses a
timeout of 1 second on Queue.get(), instead of 0.1 second, for slow
buildbots.

(cherry picked from commit 8f6eeaf21c)
2018-01-29 16:54:29 +01:00
Bo Bayles f5a793522d bpo-32304: Fix distutils upload for tar files ending with b'\r' (GH-5264) (GH-5331)
Patch by Bo Bayles.
2018-01-29 09:31:32 -05:00
Victor Stinner 6996f284d4
bpo-32667: Fix tests when $PATH contains a file (#5324)
test_subprocess.test_leaking_fds_on_error() failed when the PATH
environment variable contains a path to an existing file. Fix the
test: ignore also ENOTDIR, not only ENOENT and EACCES.
2018-01-25 22:41:38 +01:00
Gregory P. Smith b1a52b1167
Use assertItemsEqual instead of assertEqual. (#5224)
This test doesn't care about order, the underlying filesystem APIs do not
guarantee directory listings on subsequent calls will be in the same order.
2018-01-17 15:15:46 -08:00
Miss Islington (bot) 016f59a716 pythoninfo: add time.time and datetime.datetime.now (GH-5214) (#5220)
(cherry picked from commit 7d91c02504)
2018-01-17 17:58:16 +01:00
Anthony Sottile 27f32e938f bpo-32539: Fix OSError for os.listdir() for extended-length paths on Windows (#5169)
See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255&MSPPError=-2147217396#maxpath

Paths that begin with `\\?\` are "extended-length paths".
2018-01-15 23:39:04 +02:00
Serhiy Storchaka 0bcba372bc
bpo-32482: Improve syntax and grammar tests. (#5085) 2018-01-04 10:36:14 +02:00
Benjamin Peterson dbf52e02f1
bpo-31530: fix crash when multiple threads iterate over a file, round 2 (#5060)
Multiple threads iterating over a file can corrupt the file's internal readahead
buffer resulting in crashes. To fix this, cache buffer state thread-locally for
the duration of a file_iternext call and only update the file's internal state
after reading completes.

No attempt is made to define or provide "reasonable" semantics for iterating
over a file on multiple threads. (Non-crashing) races are still
present. Duplicated, corrupt, and missing data will happen.

This was originally fixed by 6401e56717, which
raised an exception from seek() and next() when concurrent operations were
detected. Alas, this simpler solution breaks legitimate use cases such as
capturing the standard streams when multiple threads are logging.
2018-01-02 09:25:41 -08:00
Serhiy Storchaka b495377a8b
[2.7] bpo-32478: Add tests for 'break' and 'return' inside 'finally' clause. (GH-5078). (#5084)
(cherry picked from commit 7cc42c356b)
2018-01-02 10:56:40 +02:00
Miss Islington (bot) 2de47ca109 bpo-32416: Add two new tests in test_sys_settrace. (GH-5072) (#5074)
Move other test to more proper place.
(cherry picked from commit e8ed96550c)
2018-01-01 20:51:12 +02:00
Segev Finer 3ceaed0dce bpo-18035: telnetlib: select.error doesn't have an errno attribute (#5044)
select.error doesn't have an errno attribute so access the errno by
indexing instead.
2017-12-29 12:44:04 -08:00
Benjamin Peterson 1f9d549a3b
[2.7] remove unused import (GH-5040). (#5043)
(cherry picked from commit e325608740)
2017-12-28 23:38:55 -08:00
Miss Islington (bot) 417f76a20e make PatternCompiler use the packaged grammar if possible (more bpo-24960) (GH-5034) (#5037)
(cherry picked from commit e5f7dccefa)
2017-12-28 18:05:07 -08:00
Serhiy Storchaka c60eca06ad
[2.7] bpo-32416: Refactor tests for the f_lineno setter and add new tests. (GH-4991). (#5017)
(cherry picked from commit 53f9135667)
2017-12-27 21:32:03 +02:00
Miss Islington (bot) 8b9995f2ae correct wording (GH-4983) (#4985)
(cherry picked from commit d11e8e0d11)
2017-12-22 21:49:49 -08:00
Benjamin Peterson 770a802df7
[2.7] bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files (GH-4977) (#4980)
This is more complicated than it should be because we need to preserve the
useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar
has. We only look for the pickled grammar file with pkgutil.get_data and only if
the source file does not exist..
(cherry picked from commit 8a5877165e)
2017-12-22 12:52:10 -08:00
Victor Stinner 2316c68640
pythoninfo: sync with master (#4843) 2017-12-13 23:23:40 +01:00
Miss Islington (bot) d663549a6a Fix improper use of re.escape() in tests. (GH-4814) (#4817)
(cherry picked from commit b748e3b258)
2017-12-12 20:49:18 +02:00
Steven Loria 3b9173d33a bpo-30806: Fix netrc.__repr__() format (GH-2491)
netrc file format doesn't support quotes and escapes.

See https://linux.die.net/man/5/netrc
2017-12-10 15:09:58 +09:00
Serhiy Storchaka 65d1887170
[2.7] bpo-10544: Deprecate "yield" in comprehensions and generator expressions in Py3k mode. (GH-4579) (#4676) 2017-12-02 21:00:09 +02:00
Barry Warsaw 56e444f8df
[2.7] bpo-32107 - Backport bitmask check fix (GH-4576) (#4590)
Remove a flakey test and rewrite another one for readability.
2017-11-29 10:34:40 -05:00
Miss Islington (bot) bc19cf57a8 bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4636)
(cherry picked from commit cc55e78aca)
2017-11-29 16:29:54 +01:00
Miss Islington (bot) fc73c54dae bpo-32110: codecs.StreamReader.read(n) now returns not more than n (GH-4499) (#4623)
characters/bytes for non-negative n.  This makes it compatible with
read() methods of other file-like objects.
(cherry picked from commit 219c2de5ad)
2017-11-29 02:15:43 +02:00
Victor Stinner 180372c08a
pythoninfo: add Py_DEBUG (#4198) (#4581)
(cherry picked from commit afd055a59f)
2017-11-27 10:44:50 +01:00
Victor Stinner 35d99830f1
bpo-31324: Optimize support._match_test() (#4523) (#4524)
* bpo-31324: Optimize support._match_test() (#4421)

* Rename support._match_test() to support.match_test(): make it
  public
* Remove support.match_tests global variable. It is replaced with a
  new support.set_match_tests() function, so match_test() doesn't
  have to check each time if patterns were modified.
* Rewrite match_test(): use different code paths depending on the
  kind of patterns for best performances.

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

* bpo-31324: Fix test.support.set_match_tests(None) (#4505)

(cherry picked from commit bb11c3c967)
(cherry picked from commit 70b2f87971)
2017-11-23 18:34:59 +01:00
Victor Stinner 2d5890eda6
test_builtin: TestExecFile removes created file (#4525)
Fix the following warning:

Warning -- files was modified by test_builtin
  Before: []
  After:  ['@test_19422_tmp']
1 test altered the execution environment:
    test_builtin
2017-11-23 18:23:37 +01:00
Victor Stinner 448c673987
bpo-29512: Fix Lib/test/bisect.py shebang (#4522)
Replace python3 with python2.
2017-11-23 17:04:34 +01:00
Gregory P. Smith e84f6d3817
[2.7] bpo-21149: Workaround a GC finalization bug in logging. (#4368)
* Work around a GC process finalization bug.

The logging RLock instances may exist but the threading.RLock class
itself has already been emptied causing a
Exception TypeError: "'NoneType' object is not callable" in <function _removeHandlerRef ..."
to be printed to stderr on process termination.

This catches that exception and ignores it because there is absolutely
nothing we can or should do about it from the context of a weakref
handler called from the gc context.
2017-11-11 14:48:49 -08:00
Serhiy Storchaka 6401e56717
[2.7] bpo-31530: Stop crashes when iterating over a file on multiple threads. (#3672) 2017-11-10 12:58:55 +02:00
Serhiy Storchaka 15e14538f9
Fix a test for select.kevent. (#4349)
select.kevent objects are now comparable with other objects in Python 2.
2017-11-09 19:04:47 +02:00
Victor Stinner 2ce1ef54d3
Fix DeprecationWarning in tests (#4345)
Define __hash__() in test_functools and test_itertools to fix the
following warning:

DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x
2017-11-08 14:45:55 -08:00
Mazay0 849482955f bpo-31955: Fix distutils CCompiler.set_executable() for Unicode (GH-4316)
Fix CCompiler.set_executable() of distutils to handle properly Unicode strings.
2017-11-08 07:48:48 -08:00
Oren Milman cd66d6d632 bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (GH-4333) 2017-11-08 01:57:02 -08:00
Miss Islington (bot) 4b544aadd5 bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (GH-3968) (#4302)
(cherry picked from commit e56ab746a9)
2017-11-06 16:44:19 -08:00
Oren Milman 30537698b6 [2.7] bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. (GH-3201) (#3951) 2017-11-06 16:17:54 -08:00
Serhiy Storchaka f72ad2d363
[2.7] bpo-9678: Fix determining the MAC address in the uuid module. (GH-4264) (#4270)
* Using ifconfig on NetBSD and OpenBSD.
* Using arp on Linux, FreeBSD, NetBSD and OpenBSD.

Based on patch by Takayuki Shimizukawa..
(cherry picked from commit ee1a9a2b78)
2017-11-04 10:23:09 +02:00
Miss Islington (bot) 6a9a331b34 bpo-31924: Fix test_curses on NetBSD 8. (GH-4228) (#4260)
(cherry picked from commit a7723d8b09)
2017-11-03 22:11:12 +02:00
Miss Islington (bot) b694770a2b bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (GH-4220) (#4222)
(cherry picked from commit 4f469c0966)
2017-11-01 21:24:00 +02:00
Miss Islington (bot) 87c66e46ce bpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4216)
(cherry picked from commit 894ebd065e)
2017-11-01 15:11:18 +02:00