Commit Graph

39565 Commits

Author SHA1 Message Date
Terry Jan Reedy 823c626b43 Issue 26911: fix import (other problems remain). 2016-05-06 15:57:57 -04:00
Raymond Hettinger 584e8aedc3 Issue 26915: Add identity checks to the collections ABC __contains__ methods. 2016-05-05 11:14:06 +03:00
Serhiy Storchaka d7062de95d Issue #26918: Skipped some tests in test_pipes on Android.
Patch by Xavier de Gaye.
2016-05-05 10:55:45 +03:00
Steven D'Aprano 3b06e24352 Issue 26002 and 25974
patches by Upendra Kumar and Stefan Krah
speed up median by using bisect, and general speedup for Decimals using as_integer_ratio
2016-05-05 03:54:29 +10:00
Jason R. Coombs ad039f7548 Issue #20120: Merge with 3.5 2016-05-04 12:00:32 -04:00
Jason R. Coombs 422cf2b4ad Issue #20120: Use RawConfigParser for .pypirc parsing, removing support for interpolation unintentionally added with move to Python 3. Behavior no longer does any interpolation in .pypirc files, matching behavior in Python 2.7 and Setuptools 19.0. 2016-05-04 11:57:32 -04:00
Serhiy Storchaka 45cdcd93c9 Issue #26873: xmlrpc now raises ResponseError on unsupported type tags
instead of silently return incorrect result.
2016-05-04 11:27:17 +03:00
Serhiy Storchaka 290fed43d9 Issue #26873: xmlrpc now raises ResponseError on unsupported type tags
instead of silently return incorrect result.
2016-05-04 11:26:42 +03:00
Serhiy Storchaka 0e120525f0 Issue #24950: Fixed expanduser tests when the users home directory in pwd is "/".
Based on patch by SilentGhost.
2016-05-03 21:17:52 +03:00
Serhiy Storchaka a3fd0b26ba Issue #24950: Fixed expanduser tests when the users home directory in pwd is "/".
Based on patch by SilentGhost.
2016-05-03 21:17:03 +03:00
Terry Jan Reedy 478be14ec0 Merge with 3.5 2016-05-02 18:30:19 -04:00
Terry Jan Reedy 929d7f86d5 Clarify IDLE-console differences with respect to the sys module.
The reload(sys) effect was the crux of a Stackoverflow question.
2016-05-02 18:30:02 -04:00
Donald Stufft 7a5842e198 Upgrade ensurepip bundled setuptools to 20.10.1 2016-05-02 07:05:29 -04:00
Donald Stufft ac96205325 Upgrade ensurepip bundled setuptools to 20.10.1 2016-05-02 07:04:59 -04:00
Donald Stufft 2a86122759 Upgrade ensurepip bundled setuptools to 20.10.1 2016-05-02 07:03:46 -04:00
Ethan Furman 354706915c issue26893: use mro() to examine class heirarchy 2016-05-01 10:04:21 -07:00
Ethan Furman 3803ad47bb issue26893: use mro() to examine class heirarchy 2016-05-01 10:03:53 -07:00
Serhiy Storchaka 47d1d7f48a Issue #26711: Fixed the comparison of plistlib.Data with other types. 2016-05-01 13:36:42 +03:00
Serhiy Storchaka dd1bcdf618 Issue #26711: Fixed the comparison of plistlib.Data with other types. 2016-05-01 13:36:16 +03:00
Meador Inge f1e2671fdf Issue #24114: Fix an uninitialized variable in `ctypes.util`.
The bug only occurs on SunOS when the ctypes implementation searches
for the `crle` program.  Patch by Xiang Zhang.  Tested on SunOS by
Kees Bos.
2016-04-30 22:17:22 -05:00
Meador Inge 8988ebf2a7 Issue #24114: Fix an uninitialized variable in `ctypes.util`.
The bug only occurs on SunOS when the ctypes implementation searches
for the `crle` program.  Patch by Xiang Zhang.  Tested on SunOS by
Kees Bos.
2016-04-30 21:56:59 -05:00
Martin Panter 51b697b7f3 Issue #26864: Merge no_proxy fixes from 3.5 2016-04-30 01:30:57 +00:00
Martin Panter aa27982ffc Issue #26864: Fix case insensitivity and suffix comparison with no_proxy
Patch by Xiang Zhang.
2016-04-30 01:03:40 +00:00
Berker Peksag 0a5bd51dd3 Issue #13436: Add a test to make sure that ast.ImportFrom(level=None) works 2016-04-29 19:50:02 +03:00
Berker Peksag dd745cc3ff Issue #25551: Test condition behavior instead of its internals
test_reset_internal_locks was looking at Event's _cond._lock. This
makes it harder to change internals of the Condition object and
makes the test fragile.

The test was added by Nir Soffer in 6108d30dde21.

Patch by Nir Soffer.
2016-04-29 17:25:51 +03:00
Berker Peksag 6d34bbbfc7 Issue #25551: Test condition behavior instead of its internals
test_reset_internal_locks was looking at Event's _cond._lock. This
makes it harder to change internals of the Condition object and
makes the test fragile.

The test was added by Nir Soffer in 6108d30dde21.

Patch by Nir Soffer.
2016-04-29 17:25:29 +03:00
Berker Peksag 3a31cca4ab Issue #24902: Print server URL on http.server startup
Initial patch by Felix Kaiser.
2016-04-29 16:48:11 +03:00
Serhiy Storchaka b275210a3b Issue #25788: fileinput.hook_encoded() now supports an "errors" argument
for passing to open.  Original patch by Joseph Hackman.
2016-04-27 23:13:46 +03:00
Serhiy Storchaka cd9b5c2f40 Issue #26634: recursive_repr() now sets __qualname__ of wrapper.
Patch by Xiang Zhang.
2016-04-26 09:31:11 +03:00
Serhiy Storchaka b3b366d803 Issue #26634: recursive_repr() now sets __qualname__ of wrapper.
Patch by Xiang Zhang.
2016-04-26 09:30:44 +03:00
Senthil Kumaran 0996fa3bd8 merge 3.5
Issue #26804: urllib.request will prefer lower_case proxy environment variables
over UPPER_CASE or Mixed_Case ones.

Patch contributed by Hans-Peter Jansen. Reviewed by Martin Panter and Senthil Kumaran.
2016-04-25 08:18:07 -07:00
Senthil Kumaran a7c0ff2f0b Issue #26804: urllib.request will prefer lower_case proxy environment variables
over UPPER_CASE or Mixed_Case ones.

Patch contributed by Hans-Peter Jansen. Reviewed by Martin Panter and Senthil Kumaran.
2016-04-25 08:16:23 -07:00
Serhiy Storchaka 159e5359d9 Remove outdated TkVersion checks.
Minimal supported Tcl/Tk version is 8.4, and this is checked in _tkinter.c.
2016-04-25 13:49:11 +03:00
Serhiy Storchaka 81e7f94076 Merge 3.5 2016-04-25 08:58:59 +03:00
Serhiy Storchaka 685fbed7f9 Issue #26837: assertSequenceEqual() now correctly outputs non-stringified
differing items (like bytes in the -b mode).  This affects assertListEqual()
and assertTupleEqual().
2016-04-25 08:58:25 +03:00
Serhiy Storchaka ccd047ea4b Removed unused imports. 2016-04-25 00:12:32 +03:00
Serhiy Storchaka a6f26c1d34 Remove more unused imports in tests. 2016-04-25 00:05:30 +03:00
Serhiy Storchaka fd2839e1de Merge 3.5 2016-04-24 23:53:16 +03:00
Serhiy Storchaka 5b6f0aa71c Remove duplicated tests.
There were duplicated methods with the same name and body.
2016-04-24 23:50:18 +03:00
Serhiy Storchaka e4fbb0206d Remove unused support.run_unittest imports.
It is not needed since tests use unittest.main().
2016-04-24 23:42:49 +03:00
Serhiy Storchaka e437a10d15 Issue #23277: Remove unused imports in tests. 2016-04-24 21:41:02 +03:00
Serhiy Storchaka 597d15afe4 Issue #23277: Remove unused support.run_unittest import. 2016-04-24 13:45:58 +03:00
Serhiy Storchaka c7f44aa99a Issue #23277: Remove more unused sys and os imports. 2016-04-24 13:25:01 +03:00
Serhiy Storchaka 18a8affc8e Issue #26801: shutil.get_terminal_size() now handles the case of stdout is
reopened on Windows.  Added tests for fallbacks.
2016-04-24 09:59:17 +03:00
Serhiy Storchaka d30829def2 Issue #26801: shutil.get_terminal_size() now handles the case of stdout is
reopened on Windows.  Added tests for fallbacks.
2016-04-24 09:58:43 +03:00
Berker Peksag 1e8ee9b380 Issue #23277: Remove unused sys and os imports
Patch by Jon Dufresne.
2016-04-24 07:31:42 +03:00
Berker Peksag e50d8465ab Issue #26041: Remove "will be removed in Python 3.7" from description messages
We will keep platform.dist() and platform.linux_distribution() to make porting
from Python 2 easier.

Patch by Kumaripaba Miyurusara Athukorala.
2016-04-24 03:32:50 +03:00
Berker Peksag 8d8221f0d6 Issue #26041: Remove "will be removed in Python 3.7" from description messages
We will keep platform.dist() and platform.linux_distribution() to make porting
from Python 2 easier.

Patch by Kumaripaba Miyurusara Athukorala.
2016-04-24 03:32:24 +03:00
Berker Peksag ce18d8c2f4 Issue #26089: Remove duplicate field 'license' from DistributionMetadata
It was renamed to 'license' in 178d19cff163.

Patch by Augustin Laville.
2016-04-24 01:55:09 +03:00
Serhiy Storchaka 745145a7da Issue #26822: itemgetter, attrgetter and methodcaller objects no longer
silently ignore keyword arguments.
2016-04-23 10:53:43 +03:00
Serhiy Storchaka c2a2a751cf Issue #26822: itemgetter, attrgetter and methodcaller objects no longer
silently ignore keyword arguments.
2016-04-23 10:51:39 +03:00
Serhiy Storchaka 8b9eefc363 Issue #26733: Disassembling a class now disassembles class and static methods.
Patch by Xiang Zhang.
2016-04-23 09:24:29 +03:00
Serhiy Storchaka 585c93daea Issue #26733: Disassembling a class now disassembles class and static methods.
Patch by Xiang Zhang.
2016-04-23 09:23:52 +03:00
Martin Panter 614827c149 Additional grammar fix 2016-04-19 04:05:59 +00:00
Martin Panter abe4d52a1a Merge doc and comment fixes from 3.5 2016-04-19 23:23:16 +00:00
Victor Stinner 5bfe0da808 Merge 3.5: issue #26801 2016-04-19 22:29:11 +02:00
Victor Stinner 119ebb70e9 Fix shutil.get_terminal_size() error handling
Issue #26801: Fix error handling in shutil.get_terminal_size(), catch
AttributeError instead of NameError. Patch written by Emanuel Barry.

test_shutil: skip the functional test using "stty size" command if
os.get_terminal_size() is missing.
2016-04-19 22:24:56 +02:00
Zachary Ware edaf8653c6 Merge with 3.5 2016-04-19 11:49:56 -05:00
Zachary Ware 75b1bdcafa Replace assert statements with self.assertXxx() calls
Sync with upstream, see github.com/python/typing/pull/205
2016-04-19 11:49:37 -05:00
Lars Gustäbel daac5f9f92 Issue #24838: Merge test_tarfile.py fix from 3.5. 2016-04-19 11:59:39 +02:00
Lars Gustäbel ddd9917ac3 Issue #24838: Fix test_tarfile.py for non-utf8 filesystem encodings. 2016-04-19 11:58:41 +02:00
Lars Gustäbel 7c3e6848f2 Issue #24838: Merge tarfile fix from 3.5. 2016-04-19 08:53:14 +02:00
Lars Gustäbel 0f450abec4 Issue #24838: tarfile's ustar and gnu formats now correctly calculate name and
link field limits for multibyte character encodings like utf-8.
2016-04-19 08:43:17 +02:00
Martin Panter 8f26565ba9 Fix spelling (inital), grammar (may translates) in documentation, comments 2016-04-19 04:03:41 +00:00
Victor Stinner 0d88c65231 Backport test_gdb fix for s390x buildbots 2016-04-20 00:30:14 +02:00
Guido van Rossum 49ed08fd0b typing.py: merge 3.5->3.6 (Tuple/ellipsis/equality). 2016-04-18 07:39:54 -07:00
Guido van Rossum 5abcbb3ee5 typing.py: Consider ellipsis in TupleMeta.__eq__. By Kalle Tuure. github.com/python/typing/pull/201. 2016-04-18 07:37:41 -07:00
Victor Stinner 27e1240af5 Merge 3.5 (test_asyncio) 2016-04-18 10:29:19 +02:00
Victor Stinner c1b578608e Fix test_asyncio.test_timeout_disable()
Issue #26777: Fix random failing of the test on the "AMD64 FreeBSD 9.x 3.5"
buildbot:

    File ".../Lib/test/test_asyncio/test_tasks.py", line 2398, in go
      self.assertTrue(0.09 < dt < 0.11, dt)
    AssertionError: False is not true : 0.11902812402695417

Replace "< 0.11" with "< 0.15".
2016-04-18 10:28:42 +02:00
Martin Panter 791ac54a44 Issue #26657: Merge http.server fix from 3.5 2016-04-18 07:16:17 +00:00
Martin Panter d274b3f1f1 Issue #26657: Fix Windows directory traversal vulnerability with http.server
Based on patch by Philipp Hagemeister.  This fixes a regression caused by
revision f4377699fd47.
2016-04-18 03:45:18 +00:00
Guido van Rossum f0f1d365c8 Sync test_typing.py with upstream git repo (typing.py was already synced). (3.5->3.6) 2016-04-17 17:53:50 -07:00
Guido van Rossum 6aafbd433d Sync test_typing.py with upstream git repo (typing.py was already synced). 2016-04-17 17:52:05 -07:00
Serhiy Storchaka b6a9c9761c Issue #26778: Fixed "a/an/and" typos in code comment, documentation and error
messages.
2016-04-17 09:39:28 +03:00
Serhiy Storchaka 6a7b3a77b4 Issue #26778: Fixed "a/an/and" typos in code comment and documentation. 2016-04-17 08:32:47 +03:00
Steven D'Aprano 5562563dd4 Automated merge with ssh://hg.python.org/cpython 2016-04-17 13:14:48 +10:00
Steven D'Aprano 4ad465424a Shorten secrets module docstring, add function docstrings. 2016-04-17 13:13:36 +10:00
Martin Panter d77133b4ce Issue #26717: Merge wsgiref fix from 3.5 2016-04-17 02:36:50 +00:00
Martin Panter 50dd1f7dd6 Issue #26717: Stop encoding Latin-1-ized WSGI paths with UTF-8
Patch by Anthony Sottile.
2016-04-17 02:17:03 +00:00
Martin Panter 528619b6c3 Issue #26782: Add STARTUPINFO to subprocess.__all__ on Windows 2016-04-16 23:42:37 +00:00
Martin Panter 9015eb4f74 Issue #26782: Merge test_subprocess from 3.5 2016-04-16 23:40:15 +00:00
Martin Panter 06172e7bd4 Issue #26782: Acknowledge the incomplete status of __all__ in 3.5
Handle is probably meant to be excluded, and STARTUPINFO will be added to
__all__ in 3.6.
2016-04-16 23:38:25 +00:00
Benjamin Peterson 50074f192d merge 3.5 2016-04-16 15:02:29 -07:00
Benjamin Peterson 8917226e4a test_support -> support 2016-04-16 15:02:23 -07:00
Benjamin Peterson 259d247b31 merge 3.5 (#26659) 2016-04-16 14:54:27 -07:00
Benjamin Peterson 2b601d3905 add gc support to slice (closes #26659) 2016-04-16 14:47:12 -07:00
Serhiy Storchaka 9e9235511e Issue #26783: test_os.WalkTests.test_walk_topdown did't test fwalk and bytes.
Patch by Aviv Palivoda.
2016-04-16 17:51:17 +03:00
Serhiy Storchaka a07ab29a79 Issue #26783: test_os.WalkTests.test_walk_topdown did't test fwalk and bytes.
Patch by Aviv Palivoda.
2016-04-16 17:51:00 +03:00
Senthil Kumaran 4d4ac5bd02 merge 3.5
issue26775 - Improve test coverage for urllib.parse
Patch contributed by Luiz Poleto.
2016-04-16 07:34:24 -07:00
Senthil Kumaran e38415e776 issue26775 - Improve test coverage for urllib.parse
Patch contributed by Luiz Poleto.
2016-04-16 07:33:15 -07:00
Martin Panter 5cad060e0d Merge subprocess test from 3.5 2016-04-16 11:51:31 +00:00
Martin Panter 23172bd47b Issue #10838: Run test__all__() everywhere, even if poll() is not available 2016-04-16 11:28:10 +00:00
Martin Panter 8b04a945ef Merge typo fixes from 3.5 2016-04-16 09:29:17 +00:00
Martin Panter 119e502277 Fix typos in code comments and documentation 2016-04-16 09:28:57 +00:00
Steven D'Aprano 6dda1b14af Remove python fallback for compare_digest.
See https://mail.python.org/pipermail/python-dev/2016-April/144198.html
https://mail.python.org/pipermail/python-dev/2016-April/144203.html
2016-04-16 04:33:55 +10:00
Victor Stinner e914d41312 Issue #26766: Fix _PyBytesWriter_Finish()
Return a bytearray object when bytearray is requested and when the small buffer
is used.

Fix also test_bytes: bytearray%args must return a bytearray type.
2016-04-15 17:52:27 +02:00
Serhiy Storchaka c9a59e6e4f Issue #26764: Fixed SystemError in bytes.__rmod__. 2016-04-15 14:11:10 +03:00
Martin Panter cda80940ed Issue #15984: Merge PyUnicode doc from 3.5 2016-04-15 02:27:11 +00:00
Martin Panter 6245cb3c01 Correct “an” → “a” with “Unicode”, “user”, “UTF”, etc
This affects documentation, code comments, and a debugging messages.
2016-04-15 02:14:19 +00:00
Steven D'Aprano 8ca020e1cc Fix missing parens. 2016-04-15 10:06:18 +10:00
Steven D'Aprano 08fbef040a Improve tests with more modern assert* methods and subTests. 2016-04-15 10:04:24 +10:00
Steven D'Aprano a873f68248 run Tools/reindent.py on secrets.py to satisfy the checkwhitespace hook 2016-04-15 01:55:14 +10:00
Steven D'Aprano 95702725ff Add secrets module and tests. 2016-04-15 01:51:31 +10:00
Ethan Furman 0fe7978c68 Issue26748: Enum classes should evaluate as True 2016-04-13 23:55:40 -07:00
Ethan Furman de4e079d3d Issue26748: Enum classes should evaluate as True 2016-04-13 23:53:45 -07:00
Ethan Furman 5de67b106a Issue26748: Enum classes should evaluate as True 2016-04-13 23:52:09 -07:00
Serhiy Storchaka 131b8f8eee Issue #26718: super.__init__ no longer leaks memory if called multiple times.
NOTE: A direct call of super.__init__ is not endorsed!
2016-04-13 15:28:53 +03:00
Serhiy Storchaka 3d7497608b Issue #26718: super.__init__ no longer leaks memory if called multiple times.
NOTE: A direct call of super.__init__ is not endorsed!
2016-04-13 15:27:33 +03:00
Senthil Kumaran 6fce35354a merge 3.5.
[minor] - Correct the docstring of locale.str. Patch by poleto.
2016-04-12 23:15:44 -07:00
Senthil Kumaran a3c532b0ed [minor] - Correct the docstring of locale.str. Patch by poleto. 2016-04-12 23:14:14 -07:00
Martin Panter 0cab9c1eba Issue #26404: Add context manager to socketserver, by Aviv Palivoda 2016-04-13 00:36:52 +00:00
Victor Stinner a07614aa31 Merge 3.5 2016-04-12 18:33:54 +02:00
Victor Stinner c6ec54d8eb Issue #26647: Fix typo in test_grammar
Patch written by Demur Rumed.
2016-04-12 18:33:41 +02:00
Victor Stinner 7e50978a4e Issue #26647: Cleanup modulefinder
Use directly dis.opmap[name] rather than dis.opname.index(name).

Patch written by Demur Rumed.
2016-04-12 18:17:06 +02:00
Victor Stinner 7b228231c7 Issue #26647: Cleanup opcode
Simplify code to build opcode.opname. Patch written by Demur Rumed.
2016-04-12 18:15:26 +02:00
Serhiy Storchaka 2940255df2 Issue #26733: Fixed formatting line numbers in test_dis.
Based on patch by Xiang Zhang.
2016-04-12 08:47:08 +03:00
Serhiy Storchaka 247763d64e Issue #26733: Fixed formatting line numbers in test_dis.
Based on patch by Xiang Zhang.
2016-04-12 08:46:28 +03:00
Martin Panter da3bb38452 Issue #26585: Eliminate _quote_html() and use html.escape(quote=False)
Patch by Xiang Zhang.
2016-04-11 00:40:08 +00:00
Martin Panter 50ab1a3694 Issue #26685: Raise OSError if closing a socket fails 2016-04-11 00:38:12 +00:00
Serhiy Storchaka 47c5474aa0 Issue #26623: TypeError message for JSON unserializible object now contains
object's type name, not object's representation.
Based on patch by Mahmoud Lababidi.
2016-04-10 15:46:30 +03:00
Serhiy Storchaka 96cdbe7bc8 Issue #26719: More efficient formatting of ints and floats in json. 2016-04-10 14:43:04 +03:00
Serhiy Storchaka e0805cf10e Issue #26719: More efficient formatting of ints and floats in json. 2016-04-10 14:41:19 +03:00
Serhiy Storchaka 403002723f Issue #25339: PYTHONIOENCODING now has priority over locale in setting the
error handler for stdin and stdout.
2016-04-10 14:35:21 +03:00
Serhiy Storchaka fc43511867 Issue #25339: PYTHONIOENCODING now has priority over locale in setting the
error handler for stdin and stdout.
2016-04-10 14:34:13 +03:00
Martin Panter cfff15d274 Issue #26712: Merge string_tests cleanup from 3.5 2016-04-10 09:16:23 +00:00
Martin Panter 731b1b12b8 Remove relics of str8 (became bytes) and buffer (bytearray) type tests
Remove redundant tests now that str is unicode.
2016-04-10 08:48:51 +00:00
Martin Panter 0d0db6cc1e Issue #26712: Unify (r)split, (l/r)strip tests into string_tests
This eliminates a few redundant test cases.
2016-04-10 08:45:26 +00:00
Martin Panter db3e2bd82d Issue #21069: Merge test_fileno() from 3.5 2016-04-09 14:05:19 +00:00
Martin Panter d979b2cfcf Issue #21069: Move test_fileno() from test_urllibnet and rewrite it
* No longer attempts to close already freed socket file descriptor
* Use socket object to be compatible with Windows
* Do not use a timeout to avoid complication with non-blocking mode
* Use internal localhost server rather than depending on a third party
* Avoid trouble with buffered HTTP data by testing tunnelled CONNECT data
2016-04-09 14:03:17 +00:00
Martin Panter ae197c9392 Issue #26609: Merge HTTP tests from 3.5 2016-04-09 12:51:41 +00:00
Berker Peksag 734423b87b Issue #16329: Add .webm to mimetypes.types_map
Patch by Giampaolo Rodola'.
2016-04-09 08:00:53 +03:00
Berker Peksag d7fdc86153 Issue #16329: Add .webm to mimetypes.types_map
Patch by Giampaolo Rodola'.
2016-04-09 08:00:20 +03:00
Martin Panter fc475a9fa6 Issue #26609: Fix HTTP server tests to request an absolute URL path 2016-04-09 04:56:10 +00:00
Berker Peksag ba22cf8bdc Issue #13952: Add .csv to mimetypes.types_map
Patch by Geoff Wilson.
2016-04-09 07:53:00 +03:00
Berker Peksag a2d7cf087f Issue #13952: Add .csv to mimetypes.types_map
Patch by Geoff Wilson.
2016-04-09 07:52:05 +03:00
Brett Cannon f3ad042bfb Issue #25609: Backport typing.ContextManager.
This has no semantic impact as the class is guarded with a hasattr()
check; this is being done to keep typing.py in sync between Python 3.5
and 3.6 as requested by Guido.
2016-04-15 10:51:30 -07:00
Serhiy Storchaka 3c149a6832 Issue #26764: Bacported tests for bytes formatting. 2016-04-15 14:13:37 +03:00
Brett Cannon 5f0507d8ab Issue #26587: Allow .pth files to specify file paths as well as
directories.

Thanks to Wolfgang Langner for the bug report and initial version of
the patch.
2016-04-08 15:04:28 -07:00
Brett Cannon ef0138f421 Issue #26668: Remove the redundant Lib/test/test_importlib/regrtest.py 2016-04-08 12:29:05 -07:00
Brett Cannon 8bd092b501 Normalize whitespace 2016-04-08 12:16:16 -07:00
Brett Cannon 9e080e0e74 Issue #25609: Introduce contextlib.AbstractContextManager and
typing.ContextManager.
2016-04-08 12:15:27 -07:00
Serhiy Storchaka c5b5ba9bda Issue #26709: Fixed Y2038 problem in loading binary PLists. 2016-04-08 15:00:33 +03:00
Serhiy Storchaka 94ad49fabc Issue #26709: Fixed Y2038 problem in loading binary PLists. 2016-04-08 15:00:02 +03:00
Serhiy Storchaka 7155b881f2 Issue #26671: Fixed tests for changed error messages. 2016-04-08 08:48:20 +03:00
Martin Panter 747be0805d Issue #26257: Merge buffer_tests cleanup from 3.5 2016-04-08 00:16:33 +00:00
Martin Panter 152a19c6bd Issue #26257: Eliminate buffer_tests.py and fix ByteArrayAsStringTest
ByteArrayAsStringTest.fixtype() was converting test data to bytes, not byte-
array, therefore many of the test cases inherited in this class were not
actually being run on the bytearray type.

The tests in buffer_tests.py were redundant with methods in string_tests
.MixinStrUnicodeUserStringTest and string_tests.CommonTest. These methods are
now moved into string_tests.BaseTest, where they will also get run for bytes
and bytearray.

This change also moves test_additional_split(), test_additional_rsplit(), and
test_strip() from CommonTest to BaseTest, meaning these tests are now run for
bytes and bytearray. I plan to eliminate redundancies with existing tests in
test_bytes.py soon.
2016-04-06 06:37:17 +00:00
Guido van Rossum 7278305698 Merge typing.py 3.5->3.6 (Text, ItemsView). 2016-04-05 14:57:03 -07:00
Guido van Rossum 0e0563ca2c Add Text=str. Make ItemsView derive from AbstractSet, not Set (which is the concrete set). 2016-04-05 14:54:25 -07:00
Guido van Rossum 6a2dc1bd03 Merge upstream typing.py changes from 3.5 branch. 2016-04-05 08:35:22 -07:00
Guido van Rossum bd5b9a0742 Many changes from the upstream repo (https://github.com/python/typing).
This syncs to rev 7b43ada77821d23e55e3a4b35f6055a59b9e1ad7 there.

Summary:

- Add typing.DefaultDict (as a generic variant of collections.defaultdict).

- Use collections.Reversible if it exists (only relevant for Python 3.6).

- Revamped generic class behavior to conform to updated PEP 484.

- Improve speed of Generic.__new__.

- Make sure __init__ is called for new Generic instances. Fix issue #26391.

- Refactor async support to be compatible with 3.2, 3.3, 3.4.

- Remove 'io' and 're' from __all__ (they still exist, just not
  included by "import *"). Fix issue #26234.

- Change @overload -- you can now use it outside stubs (you still
  cannot call the decorated function though).
2016-04-05 08:28:52 -07:00
Martin Panter c86c91aab0 Merge typo fixes from 3.5 2016-04-05 06:20:32 +00:00
Martin Panter cc71a795df Fix typos in documentation and comments 2016-04-05 06:19:42 +00:00
Guido van Rossum 16ca06b8cb Add collections.Reversible. Patch by Ivan Levkivskyi. Fixes issue #25987. 2016-04-04 10:59:29 -07:00
Martin Panter 519f91215b Issue #25951: Fix SSLSocket.sendall() to return None, by Aviv Palivoda 2016-04-03 02:12:54 +00:00
Martin Panter 50badad807 Issue #26586: Simple enhancements to BaseHTTPRequestHandler by Xiang Zhang 2016-04-03 01:28:53 +00:00
Martin Panter b93e4b2480 Issue #26586: Merge excessive HTTP header handling from 3.5 2016-04-03 01:28:49 +00:00
Martin Panter acc03195b0 Issue #26586: Handle excessive header fields in http.server, by Xiang Zhang 2016-04-03 00:45:46 +00:00
Victor Stinner 00f4648a39 Merge 3.5 (asyncio) 2016-04-01 21:43:54 +02:00
Victor Stinner c94a93aecb asyncio: Don't log ConnectionAbortedError
Issue #26509: In fatal error handlers, don't log ConnectionAbortedError which
occur on Windows.
2016-04-01 21:43:39 +02:00
Victor Stinner 89d3f53aac Merge 3.5 (asyncio) 2016-04-01 21:40:14 +02:00
Victor Stinner 2ba8ece5be asyncio: allow None as wait timeout
Fix GH#325: Allow to pass None as a timeout value to disable timeout logic.

Change written by Andrew Svetlov and merged by Guido van Rossum.
2016-04-01 21:39:09 +02:00
Martin Panter dcfebb32e2 Issue #26676: Add missing XMLPullParser to ElementTree.__all__ 2016-04-01 06:55:55 +00:00
Ned Deily 0a85c69f1d Revert back to 3.6.0, buildbots do not want chocolate for 04-01 2016-03-31 19:20:03 -04:00
Victor Stinner 49f324f1d4 Python 8: no pep8, no chocolate! 2016-03-31 23:30:53 +02:00
Martin Panter 0fc03186f7 Issue #22854: Merge test fix from 3.5 2016-03-31 21:06:06 +00:00
Martin Panter 3ee147ffbb Issue #22854: Fix logic for skipping test 2016-03-31 21:05:31 +00:00
Martin Panter f810767bd3 Issue #22854: Merge Windows pipe skipping from 3.5 2016-03-31 11:17:08 +00:00
Martin Panter 0950e6aef6 Issue #22854: Skip pipe seek tests on Windows 2016-03-31 10:31:30 +00:00
Martin Panter c0aab1da3b Issue #22854: Skip pipe seekable() tests on Windows 2016-03-31 10:31:30 +00:00
Martin Panter 047f3b7376 Issue #22854: Merge UnsupportedOperation fixes from 3.5 2016-03-31 08:25:59 +00:00
Martin Panter 754aab28ed Issue #22854: Clarify documentation about UnsupportedOperation and add tests
Also change BufferedReader.writable() and BufferedWriter.readable() to always
return False.
2016-03-31 07:21:56 +00:00
Serhiy Storchaka ab0d198c7a Issue #26492: Exhausted iterator of array.array now conforms with the behavior
of iterators of other mutable sequences: it lefts exhausted even if iterated
array is extended.
2016-03-30 21:11:16 +03:00
Serhiy Storchaka f39c0ac62f Issue #26492: Added additional tests for exhausted iterators of mutable sequences. 2016-03-30 21:01:45 +03:00
Serhiy Storchaka 8dc2ec1513 Issue #26492: Added additional tests for exhausted iterators of mutable sequences. 2016-03-30 21:01:26 +03:00
Serhiy Storchaka ab479c49d3 Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:41:15 +03:00
Serhiy Storchaka fbb1c5ee06 Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
Victor Stinner 8a34d416ba Issue #26295: Enhanc test_regrtest.test_tools_script_run_tests()
Pass all regrtest options, not only --testdir.
2016-03-30 08:51:15 +02:00
Victor Stinner 732599f793 Issue #26295: Fix test_regrtest.test_tools_buildbot_test()
Pass also --testdir option.
2016-03-30 08:38:05 +02:00
Victor Stinner d6e2502624 Issue #26295: test_regrtest now uses a temporary directory
test_forever() stores its state into the builtins module since the test module
is reloaded at each run.

Remove also warning to detect leaked tests of a previous run.
2016-03-30 02:33:52 +02:00
Victor Stinner 9759dd3343 Issue #26295: When using "python3 -m test --testdir=TESTDIR", regrtest doesn't
add "test." prefix to test module names.

regrtest also prepends testdir to sys.path.
2016-03-30 02:32:52 +02:00
Victor Stinner 7f24a98a9a Merge 3.5 (test_urllibnet) 2016-03-30 02:20:34 +02:00
Victor Stinner 53f8ba52e6 test_urllibnet: set timeout on test_fileno()
Use the default timeout of 30 seconds to avoid blocking forever.
2016-03-30 02:19:01 +02:00
Victor Stinner b1511f789e doctest now supports packages
Issue #26641: doctest.DocFileTest and doctest.testfile() now support packages
(module splitted into multiple directories) for the package parameter.
2016-03-30 01:29:05 +02:00
Victor Stinner 6e722bc13f Merge 3.5 (test_unittest) 2016-03-30 01:15:48 +02:00
Victor Stinner 9db2ae7263 Fix ResourceWarning in test_unittest when interrupted 2016-03-30 01:15:28 +02:00
Victor Stinner 06ddd35f5f Issue #25911: Backport os._DummyDirEntry fixes
* Fix test_os.BytesWalkTests on Windows
* Mimick better the reference os.DirEntry on Windows
* _DummyDirEntry now caches os.stat() result
* _DummyDirEntry constructor now tries to get os.stat()
* Fix os._DummyDirEntry.is_symlink(), don't follow symbolic links:
  use os.stat(path, follow_symlinks=False).
2016-03-29 13:38:22 +02:00
Victor Stinner 8a96389d47 Merge 3.5 (regrtest) 2016-03-29 13:34:06 +02:00
Victor Stinner 8ba2083e0e Issue #26643: Add missing shutil resources to regrtest.py 2016-03-29 13:33:35 +02:00
Victor Stinner 73030df77f Fix os._DummyDirEntry.is_symlink()
Issue #25911: Fix os._DummyDirEntry.is_symlink(), don't follow symbolic links:
use os.stat(path, follow_symlinks=False).
2016-03-29 11:25:00 +02:00
Victor Stinner 80ec58c497 fix typo in comment
Thanks Arfrever for the report :)
2016-03-29 09:50:18 +02:00
Martin Panter ef4bb1e994 Issue #23804: Merge SSL zero read fix from 3.5 2016-03-28 01:09:13 +00:00
Martin Panter f6b1d66a3c Issue #23804: Fix SSL recv/read(0) to not return 1024 bytes 2016-03-28 00:22:09 +00:00
Berker Peksag 5a6c018b57 Issue #25195: Fix a regression in mock.MagicMock
_Call is a subclass of tuple (changeset 3603bae63c13 only works
for classes) so we need to implement __ne__ ourselves.

Patch by Andrew Plummer.
2016-03-28 00:30:40 +03:00
Berker Peksag ce913877e4 Issue #25195: Fix a regression in mock.MagicMock
_Call is a subclass of tuple (changeset 3603bae63c13 only works
for classes) so we need to implement __ne__ ourselves.

Patch by Andrew Plummer.
2016-03-28 00:30:02 +03:00
Berker Peksag f841909f09 Issue #23758: Improve num_params docs of create_{function,aggregate} functions
If you pass -1, the callable can take any number of arguments.

Added tests to verify the behavior.

Initial patch by Cédric Krier.
2016-03-27 22:39:41 +03:00
Berker Peksag fa0f62d6ab Issue #23758: Improve num_params docs of create_{function,aggregate} functions
If you pass -1, the callable can take any number of arguments.

Added tests to verify the behavior.

Initial patch by Cédric Krier.
2016-03-27 22:39:14 +03:00
Victor Stinner 622583e9bf regrtest: round final timing towards +inf 2016-03-27 18:28:15 +02:00
Martin Panter afd465d497 Issue #26644: Merge SSL negative read fix from 3.5 2016-03-27 10:40:22 +00:00
Martin Panter 5503d4731e Issue #26644: Raise ValueError for negative SSLSocket.recv() and read() 2016-03-27 05:35:19 +00:00
Martin Panter 3840b2ac67 Issue #25940: Use internal local server more in test_ssl
Move many tests from NetworkedTests and NetworkedBIOTests to a new Simple-
BackgroundTests class, using the existing ThreadedEchoServer and SIGNED_
CERTFILE infrastructure.

For tests that cause the server to crash by rejecting its certificate,
separate them into independent test methods.

Added custom root certificate to capath with the following commands:

cp Lib/test/{pycacert.pem,capath/}
# Edit copy to remove part before certificate
c_rehash -v Lib/test/capath/
c_rehash -v -old Lib/test/capath/
# Note the generated file names
cp Lib/test/capath/{pycacert.pem,b1930218.0}
mv Lib/test/capath/{pycacert.pem,ceff1710.0}

Change to pure PEM version of SIGNING_CA because PEM_cert_to_DER_cert() does
not like the extra text at the start.

Moved test_connect_ex_error() into BasicSocketTests and rewrote it to connect
to a reserved localhost port.

NetworkedTests.test_get_server_certificate_ipv6() split out because it needs
to connect to an IPv6 DNS address.

The only reference left to self-signed.pythontest.net is test_timeout_
connect_ex(), which needs a remote server to reliably time out the
connection, but does not rely on the server running SSL.

Made ThreadedEchoServer call unwrap() by default when it sees the client has
shut the connection down, so that the client can cleanly call unwrap().
2016-03-27 01:53:46 +00:00
Victor Stinner 53b0a41d31 Issue #25911: more info on test_os failure 2016-03-26 01:12:36 +01:00
Victor Stinner e984eb501b Fix test_os.test_symlink(): remove create symlink 2016-03-25 22:51:17 +01:00
Alexander Belopolsky 16b698b095 merge 2016-03-25 15:46:55 -04:00
Alexander Belopolsky 1dcf4f9ee5 Issue#26616:Fixed a bug in datetime.astimezone() method. 2016-03-25 15:42:59 -04:00
Victor Stinner d7ac00e620 Backed out changeset 245a16f33c4b
Serhiy asked me to review it.
2016-03-25 19:13:06 +01:00
Victor Stinner ba8cf10873 Rework libregrtest.save_env
* Replace get/restore methods with a Resource class and Resource subclasses
* Create ModuleAttr, ModuleAttrList and ModuleAttrDict helper classes
* Use __subclasses__() to get resource classes instead of using an hardcoded
  list (2 shutil resources were missinged in the list!)
* Don't define MultiprocessingProcessDangling resource if the multiprocessing
  module is missing
* Nicer diff for dictionaries. Useful for the big os.environ dict
* Reorder code to group resources
2016-03-25 17:36:33 +01:00
Victor Stinner 32830149d8 changeset: 100749:0b61b2d28a07
tag: tip
parent: 100742:ebae81b31cf6
user: Victor Stinner <victor.stinner@gmail.com>
date: Fri Mar 25 15:03:34 2016 +0100
files: Lib/test/test_os.py
description:
test_os: Win32ErrorTests checks if file exists

Don't use os.path.exists() since it ignores *any* OSError.
2016-03-25 15:12:08 +01:00
Victor Stinner 6384c66d1f Merge 3.5 2016-03-25 12:50:54 +01:00
Victor Stinner 84ca9fe145 doctest: fix _module_relative_path() error message
Write the module name rather than <module> in the error message, if module has
no __file__ attribute (ex: package).
2016-03-25 12:50:36 +01:00
Victor Stinner 931602a1ac test_doctest: remove unused imports 2016-03-25 12:48:17 +01:00
Victor Stinner bdc337b7a8 test_venv: enhance test_devnull() 2016-03-25 12:30:40 +01:00
Victor Stinner b347788b82 Skip test_venv.test_with_pip() if ctypes miss
Issue #26610.
2016-03-25 12:27:02 +01:00
Victor Stinner e77c974357 test_os: Win32ErrorTests now ensures that TESTFN doesn't exist
Replace also other open(filename, "w") with open(filename, "x") to fail if a
previous test forgot to remove filename.
2016-03-25 10:28:23 +01:00
Victor Stinner 6c45d397a3 Issue #21925: Fix test_warnings for release mode
Use -Wd comment line option to log the ResourceWarning.
2016-03-25 09:51:14 +01:00
Victor Stinner 8a20851010 Issue #25654:
* multiprocessing: open file with closefd=False to avoid ResourceWarning
* _test_multiprocessing: open file with O_EXCL to detect bugs in tests (if a
  previous test forgot to remove TESTFN)
* test_sys_exit(): remove TESTFN after each loop iteration

Initial patch written by Serhiy Storchaka.
2016-03-25 09:29:50 +01:00
Victor Stinner 540a81c720 Issue #21925: Fix test_warnings for release mode
Use -Wd comment line option to log the ResourceWarning.
2016-03-25 09:51:14 +01:00
Victor Stinner a6d865c128 Issue #25654:
* multiprocessing: open file with closefd=False to avoid ResourceWarning
* _test_multiprocessing: open file with O_EXCL to detect bugs in tests (if a
  previous test forgot to remove TESTFN)
* test_sys_exit(): remove TESTFN after each loop iteration

Initial patch written by Serhiy Storchaka.
2016-03-25 09:29:50 +01:00
Victor Stinner 47b4557679 test_io: ignore DeprecationWarning on bytes path on Windows 2016-03-25 09:07:07 +01:00
Victor Stinner 633ebda3ba Issue #26637: Fix test_io
The import machinery now raises a different exception when it fails at Python
shutdown.
2016-03-25 08:57:16 +01:00
Victor Stinner 4f17426437 Fix bug in __import__ during Python shutdown
Issue #26637: The importlib module now emits an ImportError rather than a
TypeError if __import__() is tried during the Python shutdown process but
sys.path is already cleared (set to None).
2016-03-25 00:40:59 +01:00
Victor Stinner e091d32a7a Merge 3.5
Issue #21925: warnings.formatwarning() now catches exceptions when calling
linecache.getline() and tracemalloc.get_object_traceback() to be able to log
ResourceWarning emitted late during the Python shutdown process.
2016-03-25 00:33:12 +01:00
Victor Stinner 27461683a9 warnings.formatwarning(): catch exceptions
Issue #21925: warnings.formatwarning() now catches exceptions on
linecache.getline(...) to be able to log ResourceWarning emitted late during
the Python shutdown process.
2016-03-25 00:30:32 +01:00
Victor Stinner e0511e797c Fix test_warnings.test_improper_option()
test_warnings: only run test_improper_option() and test_warnings_bootstrap()
once. The unit test doesn't depend on self.module.
2016-03-25 00:28:56 +01:00
Victor Stinner 3aac0adfe0 Cleanup regrtest "main()" function
* Rename libregrtest.main_in_temp_cwd() to libregrtest.main()
* Add regrtest.main_in_temp_cwd() alias to libregrtest.main()
* Move old main_in_temp_cwd() code into libregrtest.Regrtest.main()
* Update multiple scripts to call libregrtest.main()
2016-03-24 17:53:20 +01:00
Victor Stinner 4ffcc3ee1e Cleanup regrtest.py
* Move code into a new _main() function
* Fix loop to cleanup sys.path
* Remove unused import
2016-03-24 17:43:53 +01:00
Victor Stinner e40390473d support.temp_dir(): call support.rmtree() instead of shutil.rmtree() 2016-03-24 17:42:10 +01:00
Victor Stinner 3899b549e3 test_os: use support.rmtree() to cleanup WalkTests 2016-03-24 17:21:17 +01:00
Victor Stinner ae39d236b4 Enhance and modernize test_os
* add create_file() helper function
* create files using "x" mode instead of "w" to detect when a previous test
  forget to remove a file
* open file for writing in unbuferred mode (buffering=0)
* replace "try/finally: unlink" with self.addCleanup(support.unlink)
* register unlink cleanup function *before* creating new files
2016-03-24 17:12:55 +01:00
Victor Stinner f95a19b900 test_os: use @support.requires_linux_version 2016-03-24 16:50:41 +01:00
Victor Stinner bc6b72ed06 Closes #26620: Fix ResourceWarning in test_urllib2_localnet
* Use context manager on urllib objects to ensure that they are closed on error
* Use self.addCleanup() to cleanup resources even if a test is interrupted
  with CTRL+c
2016-03-24 13:55:58 +01:00
Victor Stinner e321274b2e Enhance and modernize test_genericpath
* Replace "try/finally: os.remove()" with self.addCleanup(support.unlink) or
  self.addCleanup(support.rmdir): the support function handles the case when
  the file doesn't exist
* Replace "try/finally: f.close()" with "with open(...) as f:"
* test_getsize: add a second test with a different size
* Create file using "x" mode to ensure that the file didn't exist before, to
  detect bugs in tests
* Open files in unbuffered mode (buferring=0) to write immediatly data on disk
* Replace map() with simpler code
* Split isdir() unit test into two units tests to make them less dependant,
  same change for isfile() test
* test_samefile(): test also two different files
2016-03-24 13:44:19 +01:00
Victor Stinner ba8b0a7db4 Enhance os._DummyDirEntry
Issue #25911:

* Try to fix test_os.BytesWalkTests on Windows
* Try to mimick better the reference os.DirEntry on Windows
* _DummyDirEntry now caches os.stat() result
* _DummyDirEntry constructor now tries to get os.stat()
2016-03-24 12:23:18 +01:00
Victor Stinner 56db16cd44 regrtest: when parallel tests are interrupted, display progress 2016-03-24 12:04:15 +01:00
Victor Stinner 2b60b7237e regrtest: mention in tests run sequentially or in parallel 2016-03-24 11:55:29 +01:00
Victor Stinner 5de16e80c1 regrtest: fix --fromfile feature
* Update code for the name regrtest output format.
* Enhance also test_regrtest test on --fromfile
2016-03-24 09:43:00 +01:00
Victor Stinner 923590e397 Fix DeprecationWarning on Windows
Issue #25911: Use support.check_warnings() to expect or ignore
DeprecationWarning in test_os.
2016-03-24 09:11:48 +01:00
Victor Stinner 0069aef51a Fix test_spwd on OpenIndiana
Issue #18787: restore "bin" name in test_spwd but catch KeyError.
2016-03-23 21:15:55 +01:00
Victor Stinner c53195bbf0 Try to fix test_gdb on s390x SLES 3.x
Ignore empty lines in stderr.
2016-03-23 21:08:25 +01:00
Stefan Krah 1129084ebd Issue #26621: Remove unnecessary test. 2016-03-23 20:53:22 +01:00
Stefan Krah 66e9d03bf4 Issue #26621: Update libmpdec version and remove unnecessary test case. 2016-03-23 20:50:10 +01:00
Victor Stinner 4a1c7d2c36 Try to fix test_spwd on OpenIndiana
Issue #18787: try to get the "root" entry which should exist on all UNIX
instead of "bin" which doesn't exist on OpenIndiana.
2016-03-23 18:45:55 +01:00
Victor Stinner 904f5def5c Try to fix test_gdb on s390x buildbots 2016-03-23 18:32:54 +01:00
Victor Stinner 412a5e7e23 faulthandler: only log fatal exceptions
Issue #23848, #26622:

* faulthandler now only logs fatal Windows exceptions.
* write error code as decimal, not as hexadecimal
* replace "Windows exception" with "Windows fatal exception"
2016-03-23 14:44:14 +01:00
Victor Stinner 69649f21f0 regrtest: display test duration in sequential mode
Only display duration if a test takes more than 30 seconds.
2016-03-23 12:14:10 +01:00
Victor Stinner 404cdc5a92 faulthandler: add Windows exception handler
Issue #23848: On Windows, faulthandler.enable() now also installs an exception
handler to dump the traceback of all Python threads on any Windows exception,
not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT).
2016-03-23 10:39:17 +01:00
Victor Stinner 6d7f4f6675 regrtest: add timeout to main process when using -jN
libregrtest: add a watchdog to run_tests_multiprocess() using
faulthandler.dump_traceback_later().
2016-03-23 02:04:32 +01:00
Victor Stinner e19558af1b Add a source parameter to warnings.warn()
Issue #26604:

* Add a new optional source parameter to _warnings.warn() and warnings.warn()
* Modify asyncore, asyncio and _pyio modules to set the source parameter when
  logging a ResourceWarning warning
2016-03-23 00:28:08 +01:00
Victor Stinner f9a71153e9 Issue #26588: remove debug traces from _tracemalloc. 2016-03-22 23:54:42 +01:00
Victor Stinner 92c21d7a7c Issue #26588: skip test_warnings.test_tracemalloc() 2016-03-22 21:26:31 +01:00
Victor Stinner 84aab09421 Issue #26588: add debug traces
Try to debug random failure on buildbots.
2016-03-22 16:13:31 +01:00