Commit Graph

37297 Commits

Author SHA1 Message Date
Yury Selivanov 08e5300afc collections.abc.tests: Remove some unnecessary code. 2015-05-13 23:57:59 -04:00
Yury Selivanov aded55c6e3 collections.abc: Test that if an object is a Coroutine it is also an Awaitable 2015-05-13 23:41:55 -04:00
Yury Selivanov 6abe03288b inspect: Add __slots__ to BoundArguments. 2015-05-13 17:18:41 -04:00
Yury Selivanov 9113dc7c97 Issue 24017: More tests for 'async for' and 'async with'. 2015-05-13 16:49:35 -04:00
Yury Selivanov c41632a856 asyncio/tests: Drop unused import. 2015-05-13 15:37:48 -04:00
Yury Selivanov 6c792bd65a asyncio: Add a test for asyncio.iscoroutine().
Test that asyncio.iscoroutine() supports 'async def' coroutines and
collections.abc.Coroutine types.
2015-05-13 15:34:12 -04:00
Yury Selivanov af928b65fc asyncio: Use 'collections.abc.Coroutine' in asyncio.iscoroutine. 2015-05-13 15:22:03 -04:00
Yury Selivanov c58cca5951 asyncio: Use 'collections.abc.Coroutine' in asyncio.iscoroutine (in 3.5) 2015-05-13 15:21:41 -04:00
Yury Selivanov d08c363c26 Sync asyncio code from default branch. 2015-05-13 15:15:56 -04:00
Yury Selivanov 33c6b569b7 Issue 24179: Support 'async for' for asyncio.StreamReader. 2015-05-13 14:23:29 -04:00
Yury Selivanov 29f88c22e6 Issue 24178: support 'async with' for asyncio locks. 2015-05-13 14:10:38 -04:00
Berker Peksag 50c72d2778 Issue #22064: Improve the misleading message from 2to3 when skipping optional fixers.
Patch by Vinod Kurup.
2015-05-13 13:40:12 +03:00
Berker Peksag 3a81f9ba46 Issue #22064: Improve the misleading message from 2to3 when skipping optional fixers.
Patch by Vinod Kurup.
2015-05-13 13:39:51 +03:00
Berker Peksag 2f3742b0d8 Issue #1322: platform.dist() and platform.linux_distribution() functions are now deprecated.
Initial patch by Vajrasky Kok.
2015-05-13 12:32:20 +03:00
Raymond Hettinger eac503aeac Issue #24064: Property() docstrings are now writeable.
(Patch by Berker Peksag.)
2015-05-13 01:09:59 -07:00
Zachary Ware 37ac590f7c Clean up test_coroutines a bit.
No more test_main(), s/assertEquals/assertEqual/, and remove unused import.
2015-05-13 01:03:06 -05:00
Nick Coghlan baaadbf70d Issue 24017: fix for "async with" refcounting
* adds missing INCREF in WITH_CLEANUP_START
* adds missing DECREF in WITH_CLEANUP_FINISH
* adds several new tests Yury created while investigating this
2015-05-13 15:54:02 +10:00
Zachary Ware 84d3e764d7 Issue #23911: Fix ctypes test on Windows.
Comparing equality of list and tuple is always False.
2015-05-13 00:34:39 -05:00
Zachary Ware d9b25bb511 Issue #23731: Fix tracemalloc test on Windows.
'a.pyo' can no longer match 'a.py', so 'a.PYO' can't either.
2015-05-13 00:27:01 -05:00
Zachary Ware ad3e27ae4c Issue #23193: Skip numeric_owner tests on platforms where they don't make sense
In particular, the tests bomb out on Windows.  The feature is a no-op on platforms
without the pwd module or os.geteuid anyway.
2015-05-12 23:57:21 -05:00
Raymond Hettinger 849564f874 Extend test coverage to include heapifying large heaps 2015-05-12 21:42:40 -07:00
Raymond Hettinger ffcd8490d0 Reduce the overhead in functools.total_ordering by localizing NotImplemented.
(Sugguested by Serhiy Storchaka)
2015-05-12 21:26:37 -07:00
Serhiy Storchaka cd4a5cc339 Added forgotten new files for issues #22681 and #22682. 2015-05-13 00:34:53 +03:00
Serhiy Storchaka 48e47aaa28 Issue #22486: Added the math.gcd() function. The fractions.gcd() function now is
deprecated.  Based on patch by Mark Dickinson.
2015-05-13 00:19:51 +03:00
Serhiy Storchaka f0eeedf0d8 Issue #22681: Added support for the koi8_t encoding. 2015-05-12 23:24:19 +03:00
Serhiy Storchaka ad8a1c3fb2 Issue #22682: Added support for the kz1048 encoding. 2015-05-12 23:16:55 +03:00
Yury Selivanov fdba8381ff Issue #24017: Unset asyncio event loop after test. 2015-05-12 14:28:08 -04:00
Yury Selivanov 08a7a4e592 asyncio: Make sure sys.set_coroutine_wrapper is called *only* when loop is running.
Previous approach of installing coroutine wrapper in loop.set_debug() and
uninstalling it in loop.close() was very fragile.  Most of asyncio tests
do not call loop.close() at all.  Since coroutine wrapper is a global
setting, we have to make sure that it's only set when the loop is
running, and is automatically unset when it stops running.

Issue #24017.
2015-05-12 11:43:35 -04:00
Yury Selivanov e8944cb217 asyncio: Make sure sys.set_coroutine_wrapper is called *only* when loop is running.
Previous approach of installing coroutine wrapper in loop.set_debug() and
uninstalling it in loop.close() was very fragile.  Most of asyncio tests
do not call loop.close() at all.  Since coroutine wrapper is a global
setting, we have to make sure that it's only set when the loop is
running, and is automatically unset when it stops running.

Issue #24017.
2015-05-12 11:43:04 -04:00
Berker Peksag ea6d5592f2 Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
if they called on a closed object.

Patch by John Hergenroeder.
2015-05-12 17:13:56 +03:00
Berker Peksag d10d6ae2fa Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
if they called on a closed object.

Patch by John Hergenroeder.
2015-05-12 17:01:05 +03:00
Serhiy Storchaka bedbf96e84 Issue #23870: The pprint module now supports all standard collections
except named tuples.
2015-05-12 13:35:48 +03:00
Yury Selivanov 7544508f02 PEP 0492 -- Coroutines with async and await syntax. Issue #24017. 2015-05-11 22:57:16 -04:00
Yury Selivanov dc6a9c0423 asyncio: Merge 3.4 -- Support PEP 492. Issue #24017. 2015-05-11 22:31:19 -04:00
Yury Selivanov 1af2bf75a2 asyncio: Support PEP 492. Issue #24017. 2015-05-11 22:27:25 -04:00
Yury Selivanov 9657caf168 Merge 3.4 (asyncio changes) 2015-05-11 14:50:41 -04:00
Yury Selivanov 59eb9a4da5 asyncio: async() function is deprecated in favour of ensure_future(). 2015-05-11 14:48:38 -04:00
Yury Selivanov 926b990d3d asyncio: Drop JoinableQueue from 3.5 2015-05-11 14:42:43 -04:00
Yury Selivanov 7a093d9c71 Merge 3.4 (asyncio) 2015-05-11 14:40:56 -04:00
Yury Selivanov 740169cd24 Sync asyncio changes from the main repo. 2015-05-11 14:23:38 -04:00
Yury Selivanov 90ecfe65e6 asyncio: Sync with github repo 2015-05-11 13:48:16 -04:00
R David Murray a33df31629 #21795: advertise 8BITMIME if decode_data is False.
Patch by Milan Oberkirch, with a few updates.  This changeset also
tweaks the smtpd and whatsnew docs for smtpd into what should be
the final form for the 3.5 release.
2015-05-11 12:11:40 -04:00
R David Murray a6429db4b8 #21800: Add RFC 6855 support to imaplib.
Original patch by Milan Oberkirch, updated by myself and
Maciej Szulik.
2015-05-10 19:17:23 -04:00
Yury Selivanov e9ad5a57d7 Issue 22906: Add test file. 2015-05-09 13:53:57 -04:00
Yury Selivanov 8170e8c0d1 PEP 479: Change StopIteration handling inside generators.
Closes issue #22906.
2015-05-09 11:44:30 -04:00
Raymond Hettinger bd60e8dece Issue #24018: Add a collections.Generator abstract base class. 2015-05-09 01:07:23 -04:00
Benjamin Peterson dae2ef1cfa merge 3.4 2015-05-09 00:29:08 -04:00
Benjamin Peterson 65bcdd7195 ensure .keywords is always a dict 2015-05-09 00:25:18 -04:00
Donald Stufft 9020a9a226 merge - upgrade setuptools to 15.2 2015-05-08 21:30:37 -04:00
Donald Stufft b0fc24bff4 Upgrade setuptools to 15.2 2015-05-08 21:30:04 -04:00
Larry Hastings 8093254597 Merge from 3.4. 2015-05-08 06:58:56 -07:00
Larry Hastings 7e63b36f7f Issue #21520: test_zipfile no longer fails if the word 'bad' appears
anywhere in the name of the current directory.
2015-05-08 06:54:58 -07:00
Serhiy Storchaka fe373a5425 Fixed English in error message. 2015-05-06 19:22:55 +03:00
Serhiy Storchaka 4b5367c46d Fixed English in error message. 2015-05-06 19:21:00 +03:00
Serhiy Storchaka 24d3b7f9df Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() checks are not longer successful if the callable is None.

Added tests for assertRaises().
2015-05-06 19:14:47 +03:00
Serhiy Storchaka e130503c7b Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() checks are not longer successful if the callable is None.

Added tests for assertRaises().
2015-05-06 19:13:11 +03:00
Serhiy Storchaka 645058d11a Issue #23880: Tkinter's getint() and getdouble() now support Tcl_Obj.
Tkinter's getdouble() now supports any numbers (in particular int).
2015-05-06 14:00:04 +03:00
Serhiy Storchaka 9749b5a6a3 Issue #24125: Saved error's line and column numbers when an error is occured
during closing expatreader.  Fixed a regression introduced in issue #23865.
2015-05-06 09:38:22 +03:00
Serhiy Storchaka ab914780ba Issue #24125: Saved error's line and column numbers when an error is occured
during closing expatreader.  Fixed a regression introduced in issue #23865.
2015-05-06 09:36:06 +03:00
Berker Peksag 076dbd0560 Fix remaining tests and remove an unused import. 2015-05-06 07:01:52 +03:00
Berker Peksag ce643913a9 Issue #9517: Move script_helper to the support package.
Patch by Christie Wilson.
2015-05-06 06:33:17 +03:00
Benjamin Peterson 025e9ebd0a PEP 448: additional unpacking generalizations (closes #2292)
Patch by Neil Girdhar.
2015-05-05 20:16:41 -04:00
Raymond Hettinger ad17be7682 Issue #24113: Remove unreachable code in shlex. 2015-05-04 22:45:47 -04:00
Eric Snow 00607e91bd Issue #23911: Fix mixed bytes/strings. 2015-05-04 11:48:39 -06:00
Benjamin Peterson 63a6a6fd41 merge 3.4 (#24096) 2015-05-03 11:29:58 -04:00
Benjamin Peterson 8c59816b70 merge 3.3 (#24096) 2015-05-03 11:28:46 -04:00
Benjamin Peterson deff2b76ec be more robust against the filters list changing under us (closes #24096) 2015-05-03 11:23:37 -04:00
Serhiy Storchaka 24559e4834 Issue #22619: Added negative limit support in the traceback module.
Based on patch by Dmitry Kazakov.
2015-05-03 13:19:46 +03:00
Benjamin Peterson 88abdef02b merge 3.4 (#24094) 2015-05-02 22:37:13 -04:00
Benjamin Peterson 122f4b1bda merge 3.3 (#24094) 2015-05-02 22:36:26 -04:00
Benjamin Peterson 501182a47b just sort the items tuple directly (closes #24094) 2015-05-02 22:28:04 -04:00
Guido van Rossum 97bd4b0cd9 Asyncio issue 222 / PR 231 (Victor Stinner) -- fix @coroutine functions without __name__. (Merged from 3.4 branch.) 2015-05-02 18:45:51 -07:00
Guido van Rossum 0a9933ebf3 Asyncio issue 222 / PR 231 (Victor Stinner) -- fix @coroutine functions without __name__. 2015-05-02 18:38:24 -07:00
Eric Snow 32439d6eb6 Issue #23911: Move path-based bootstrap code to a separate frozen module. 2015-05-02 19:15:18 -06:00
Benjamin Peterson 1dfd247c1b remove the concept of an unoptimized function scope from the compiler, since it can't happen anymore 2015-04-27 21:44:22 -04:00
Gregory P. Smith 32d34bcf1d Use assertEqual rather than assertEquals to avoid the deprecation warning. 2015-04-26 05:05:53 +00:00
Gregory P. Smith 8cb6569fe1 Implements issue #9951: Adds a hex() method to bytes, bytearray, & memoryview.
Also updates a few internal implementations of the same thing to use the
new built-in code.

Contributed by Arnon Yaari.
2015-04-25 23:22:26 +00:00
Serhiy Storchaka 84de1bf281 Issue #23713: Fixed fragility of test_imap_unordered_handle_iterable_exception.
Patch by Davin Potts.
2015-04-23 11:36:40 +03:00
Serhiy Storchaka 71f73ca7a9 Issue #23713: Fixed fragility of test_imap_unordered_handle_iterable_exception.
Patch by Davin Potts.
2015-04-23 11:35:59 +03:00
Serhiy Storchaka f28d54d3b9 Use more precise Tcl version checks in tests. 2015-04-23 10:58:15 +03:00
Serhiy Storchaka 3bd66abb94 Use more precise Tcl version checks in tests. 2015-04-23 10:57:40 +03:00
Facundo Batista 244afcf26c Issue #23887: urllib.error.HTTPError now has a proper repr() representation. 2015-04-22 18:35:54 -03:00
Berker Peksag 30912f3db0 Issue #21483: Skip test_timestamp_overflow on NFS.
Patch by Isaac Schwabacher.
2015-04-22 11:32:19 +03:00
Serhiy Storchaka 949c416dc6 Merge heads 2015-04-22 11:01:38 +03:00
Serhiy Storchaka 71b49dde3a Issue #16840. Turn off bignum support in tkinter with with Tcl earlier than 8.5.8
(tclTomMath.h was broken) and non-final Tcl 8.6.
Removed TK_VERSION_HEX.
2015-04-22 10:59:32 +03:00
Serhiy Storchaka 3af7a38c61 Issue #16840. Turn off bignum support in tkinter with with Tcl earlier than 8.5.8
(tclTomMath.h was broken) and non-final Tcl 8.6.
2015-04-22 10:53:08 +03:00
Berker Peksag d86ef05a02 Issue #23917: Fall back to sequential compilation when ProcessPoolExecutor doesn't exist.
Patch by Claudiu Popa.
2015-04-22 09:39:19 +03:00
Serhiy Storchaka aec0509193 Fixed full Tcl version parsing in tests for pre-final versions. 2015-04-22 08:36:41 +03:00
Serhiy Storchaka 462c357d70 Fixed full Tcl version parsing in tests for pre-final versions. 2015-04-22 08:36:03 +03:00
Andrew Kuchling c3a7f18100 Merge from 3.4 2015-04-21 19:44:54 -04:00
Andrew Kuchling 333518e01d #15183: clarify timeit documentation to say that setup statement isn't timed 2015-04-21 19:43:33 -04:00
Serhiy Storchaka f5e8540e1b Issue #23008: Fixed resolving attributes with boolean value is False in pydoc. 2015-04-21 21:11:13 +03:00
Serhiy Storchaka b6076fb13c Issue #23008: Fixed resolving attributes with boolean value is False in pydoc. 2015-04-21 21:09:48 +03:00
Benjamin Peterson 273a720f87 merge 3.4 (#24022) 2015-04-21 12:07:06 -04:00
Benjamin Peterson d73aca769f do not call into python api if an exception is set (#24022) 2015-04-21 12:05:19 -04:00
Greg Ward 4d9d2563f5 #17445: difflib: add diff_bytes(), to compare bytes rather than str
Some applications (e.g. traditional Unix diff, version control
systems) neither know nor care about the encodings of the files they
are comparing. They are textual, but to the diff utility they are just
bytes. This worked fine under Python 2, because all of the hardcoded
strings in difflib.py are ASCII, so could safely be combined with
old-style u'' strings. But it stopped working in 3.x.

The solution is to use surrogate escapes for a lossless
bytes->str->bytes roundtrip. That means {unified,context}_diff() can
continue to just handle strings without worrying about bytes. Callers
who have to deal with bytes will need to change to using diff_bytes().

Use case: Mercurial's test runner uses difflib to compare current hg
output with known good output. But Mercurial's output is just bytes,
since it can contain:
  * file contents (arbitrary unknown encoding)
  * filenames (arbitrary unknown encoding)
  * usernames and commit messages (usually UTF-8, but not guaranteed
    because old versions of Mercurial did not enforce it)
  * user messages (locale encoding)

Since the output of any given hg command can include text in multiple
encodings, it is hopeless to try to treat it as decodable Unicode
text. It's just bytes, all the way down.

This is an elaboration of a patch by Terry Reedy.
2015-04-20 20:21:21 -04:00
Guido van Rossum f75d4a7ad0 Fix asyncio issue 235 (merge from 3.4). 2015-04-20 09:29:57 -07:00
Guido van Rossum 0bd16bc4cd Fix asyncio issue 235: Queue subclass bug caused by JoinableQueue merge. 2015-04-20 09:24:24 -07:00
Larry Hastings 1acdb95965 Merge Python 3.5.0a4 release engineering commits. 2015-04-20 01:19:55 -07:00
Serhiy Storchaka 7e9d1d1a1b Issue #23908: os functions now reject paths with embedded null character
on Windows instead of silently truncate them.

Removed no longer used _PyUnicode_HasNULChars().
2015-04-20 10:12:28 +03:00
Serhiy Storchaka 2b0d2007a1 Issue #23908: os functions now reject paths with embedded null character
on Windows instead of silently truncate them.
2015-04-20 09:53:58 +03:00
Serhiy Storchaka e3037e1145 Issue #23728: binascii.crc_hqx() could return an integer outside of the range
0-0xffff for empty data.
2015-04-20 09:31:51 +03:00
Serhiy Storchaka 2ef7c47844 Issue #23728: binascii.crc_hqx() could return an integer outside of the range
0-0xffff for empty data.
2015-04-20 09:26:49 +03:00
Serhiy Storchaka c74bb9d350 Issue #23842: Added tests for os.major(), os.minor() and os.makedev(). 2015-04-20 09:23:21 +03:00
Serhiy Storchaka 16b2e4f548 Issue #23842: Added tests for os.major(), os.minor() and os.makedev(). 2015-04-20 09:22:13 +03:00
Larry Hastings 55907f45bb Version number bump for Python 3.5.0a4. 2015-04-19 13:51:40 -07:00
Larry Hastings 770ce204ee Regenerated pydoc-topics and fixed bad/suspicious doc markup for Python 3.5.0a4. 2015-04-19 13:50:12 -07:00
R David Murray 37f1ba915b #16914: fix test errors under -W error::BytesWarning.
There are doubtless other debug messages in smtplib that would trigger an
error if they were tested, but this fixes the things we do now test,
which is good enough for now.
2015-04-16 18:54:56 -04:00
R David Murray 0c49b896e6 #16914: add timestamps to smtplib debugging output via new debuglevel 2.
Patch by Gavin Chappell and Maciej Szulik.
2015-04-16 17:14:42 -04:00
R David Murray 4c7f995e80 #7159: generalize urllib prior auth support.
This fix is a superset of the functionality introduced by the issue #19494
enhancement, and supersedes that fix.  Instead of a new handler, we have a new
password manager that tracks whether we should send the auth for a given uri.
This allows us to say "always send", satisfying #19494, or track that we've
succeeded in auth and send the creds right away on every *subsequent* request.
The support for using the password manager is added to AbstractBasicAuth,
which means the proxy handler also now can handle prior auth if passed
the new password manager.

Patch by Akshit Khurana, docs mostly by me.
2015-04-16 16:36:18 -04:00
R David Murray 2b78129b3a #18128: use standard +NNNN timezone format in POT-Creation-Date header.
Patch by Michael McFadden, with a few small style tweaks.
2015-04-16 12:15:09 -04:00
Serhiy Storchaka 6a69466f61 Backported tests from issue #20175. 2015-04-16 11:54:14 +03:00
Serhiy Storchaka f24131ff31 Issue #20175: Converted the _io module to Argument Clinic. 2015-04-16 11:19:43 +03:00
Ned Deily 3b8124884c Issues #22980, 23969: For OS X, use PEP 3149-style file names for extension
module binaries, with a platform triple of just "darwin", resulting in
file names like:

    _ssl.cpython-35m-darwin.so

rather than just _ssl.so as previously.

Instead of attempting to encode differences in CPU architecture and OS X
deployment targets in the file name as is done on other platforms,
these continue to be managed by the use of Apple multi-architecture
("fat") files, by the system dynamic loader, and by logic in higher-levels
like sysconfig.get_platform() and pip.
2015-04-15 17:11:47 -07:00
Berker Peksag 20416f7994 Issue #23703: Fix a regression in urljoin() introduced in 901e4e52b20a.
Patch by Demian Brecht.
2015-04-16 02:31:14 +03:00
Steve Dower d2bc389e55 Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari 2015-04-15 18:06:05 -04:00
R David Murray 4171bbe687 #23949: Improve tuple unpacking error messages.
Patch by Arnon Yaari.
2015-04-15 17:08:45 -04:00
Steve Dower cb39d1f466 Issue 19933: Provide default argument for ndigits in round. Patch by Vajrasky Kok. 2015-04-15 16:10:59 -04:00
doko@ubuntu.com 807b80d4ec - #22980: fix typo in Lib/test/test_sysconfig.py triplet test 2015-04-15 20:52:39 +02:00
doko@ubuntu.com d3899c1a96 - Issue #22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include
the architecture triplet in the extension name, to make it easy to test builds
  for different ABIs in the same working tree.
2015-04-15 20:23:14 +02:00
Eric V. Smith 7a80389ce5 Issue 23193: Add numeric_owner to tarfile.TarFile.extract() and tarfile.TarFile.extractall(). 2015-04-15 10:27:58 -04:00
Gregory P. Smith 6e73000723 Add a subprocess.run() function than returns a CalledProcess instance for a
more consistent API than the existing call* functions.
(enhancement from issue 23342)
2015-04-14 16:14:25 -07:00
Antoine Pitrou a8723a02ea Issue #21217: inspect.getsourcelines() now tries to compute the start and
end lines from the code object, fixing an issue when a lambda function is
used as decorator argument.  Patch by Thomas Ballinger.
2015-04-15 00:41:29 +02:00
R David Murray 687592def9 Merge: #23925: stop (eg) PYTHONSTARTUP from causing test_cmd_line failure. 2015-04-14 17:58:40 -04:00
R David Murray f4bbc535b9 #23925: stop (eg) PYTHONSTARTUP from causing test_cmd_line failure.
Patch by Jamiel Almeida.
2015-04-14 17:57:41 -04:00
Gregory P. Smith 14a88abfcc issue9859: Use an expected failure rather than a skip. 2015-04-14 13:54:09 -07:00
Zachary Ware cadbab295d Closes #23956: Merge with 3.4 2015-04-14 15:46:22 -05:00
Zachary Ware 50db6acc9b Issue #23956: Fix typo in imp.py docstring.
Patch by Jacinda Shelly.
2015-04-14 15:43:00 -05:00
Gregory P. Smith 4e72cceb62 issue9859: Document test.support.detect_api_mismatch() and simplify its test. 2015-04-14 13:26:06 -07:00
Gregory P. Smith 1bef9075b8 issue9859: rename CPyMatchTest to APIMismatchTest and add @support.cpython_only. 2015-04-14 13:24:34 -07:00
Gregory P. Smith 054b065f6c issue9859: Adds a CPyMatchTest test case to compare the exposed APIs
of the Python io module and the C io module.  They do not currently
match so the failing test is marked with @unittest.skip.
2015-04-14 12:58:05 -07:00
Gregory P. Smith e334e3ff71 issue9859: Adds a test.support.detect_api_mismatch function useful to
compare the public APIs of two modules or classes.
2015-04-14 12:56:53 -07:00
Berker Peksag 012e287081 Issue #23811: Add missing newline to the PyCompileError error message.
Patch by Alex Shkop.
2015-04-14 18:58:45 +03:00
Berker Peksag 34c9be7ebd Issue #23811: Add missing newline to the PyCompileError error message.
Patch by Alex Shkop.
2015-04-14 18:57:55 +03:00
Andrew Kuchling 19ddaf6d40 Merge from 3.4 2015-04-14 10:35:43 -04:00
Andrew Kuchling 467a546b5e Merge from 3.4 2015-04-14 09:59:09 -04:00
Berker Peksag dfa4e045a3 Issue #23943: Fix typos. Patch by Piotr Kasprzyk. 2015-04-14 09:35:51 +03:00
Berker Peksag 4882cacab6 Issue #23943: Fix typos. Patch by Piotr Kasprzyk. 2015-04-14 09:30:01 +03:00
Łukasz Langa a468db9b0b Issue #23310: Fix MagicMock's initializer to work with __methods__.
Behavior equivalent to m.configure_mock().  Patch by Kasia Jachim.
2015-04-13 23:12:42 -07:00
Benjamin Peterson cd1aa9158e merge 3.4 (#23929) 2015-04-13 20:25:11 -04:00
Benjamin Peterson 52a3b74900 remove useless word (closes #23929) 2015-04-13 20:24:10 -04:00
R David Murray 0a8f43e85a #11754: test contents of string module attributes.
As noted in the comment, while the order of the items in the attributes is not
technically guaranteed, after all this time there is almost certainly user
code out there that relies on it, so we might as well test for it.

Patch by Chalmer Lowe.
2015-04-13 20:04:29 -04:00
Zachary Ware 8ef887ce47 Issue #20586: Argument Clinic now ensures signatures on functions without docstrings. 2015-04-13 18:22:35 -05:00
Brett Cannon 9d2a01fb2b Issue #23822: Fix test_py_compile to not fail under -O. 2015-04-13 16:28:11 -04:00
Zachary Ware 38c707e7e0 Issue #21741: Update 147 test modules to use test discovery.
I have compared output between pre- and post-patch runs of these tests
to make sure there's nothing missing and nothing broken, on both
Windows and Linux.  The only differences I found were actually tests
that were previously *not* run.
2015-04-13 15:00:43 -05:00
Antoine Pitrou d5aec7ba48 Issue #21116: Avoid blowing memory when allocating a multiprocessing shared
array that's larger than 50% of the available RAM.

Patch by Médéric Boquien.
2015-04-13 20:53:43 +02:00
Brett Cannon f299abdafa Issue #23731: Implement PEP 488.
The concept of .pyo files no longer exists. Now .pyc files have an
optional `opt-` tag which specifies if any extra optimizations beyond
the peepholer were applied.
2015-04-13 14:21:02 -04:00
Antoine Pitrou a63cc21234 Issue #23726: Don't enable GC for user subclasses of non-GC types that don't add any new fields.
Patch by Eugene Toder.
2015-04-13 20:10:06 +02:00
Antoine Pitrou 56452eea39 Issue #22982: Improve BOM handling when seeking to multiple positions of a writable text file. 2015-04-13 20:02:33 +02:00
Antoine Pitrou 85e3ee749c Issue #22982: Improve BOM handling when seeking to multiple positions of a writable text file. 2015-04-13 20:01:21 +02:00
Antoine Pitrou 0f164c606a Merge 2015-04-13 19:49:04 +02:00
Antoine Pitrou 20d31b5182 Merge 2015-04-13 19:48:52 +02:00
Antoine Pitrou cb46f0ecb0 Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
while it is holding a lock to a buffered I/O object, and the main thread
tries to use the same I/O object (typically stdout or stderr).  A fatal
error is emitted instead.
2015-04-13 19:48:19 +02:00
Antoine Pitrou 25f85d4bd5 Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
while it is holding a lock to a buffered I/O object, and the main thread
tries to use the same I/O object (typically stdout or stderr).  A fatal
error is emitted instead.
2015-04-13 19:41:47 +02:00
Zachary Ware 774ac377da Closes #17202: Merge with 3.4 2015-04-13 12:11:40 -05:00
Zachary Ware 4c9c848159 Issue #17202: Add .bat to .hgeol to force them to CRLF.
Using LF can a script to fail if it tries to use a label that is
split across 512 byte blocks.  Who knows why.
2015-04-13 11:59:54 -05:00
Nick Coghlan 9c680b0728 Actually run the builtins Argument Clinic test 2015-04-13 12:54:54 -04:00
Andrew Kuchling 8b963c5853 #17898: reset k and v so that the loop doesn't use an old value 2015-04-13 10:38:56 -04:00
Andrew Kuchling 770b08e8e2 #23883: add names missing from __all__ (l*gettext, bind_textdomain_codeset) 2015-04-13 09:58:36 -04:00
Łukasz Langa 5f6684efe0 Issue #23310: Fix MagicMock's initializer to work with __methods__.
Behavior equivalent to m.configure_mock().  Patch by Kasia Jachim.
2015-04-14 00:12:57 -07:00
R David Murray e81a773352 #23464: remove JoinableQueue that was deprecated in 3.4.4.
Patch by A. Jesse Jiryu Davis.
2015-04-12 18:47:56 -04:00
Ethan Furman 48a724fa33 Close issue23900: add default __doc__ to new enumerations that do not specify one. 2015-04-11 23:23:06 -07:00
Guido van Rossum e173c07502 Unittest for Issue 21511 by Christie Wilson bobcatfish@gmail.com. 2015-04-11 17:44:01 -04:00
Berker Peksag ecb75e26db Issue #23062: Add a test for suppressing --version with argparse.SUPPRESS.
TestHelpVersionOptional was redundant.
2015-04-10 16:11:12 +03:00
Serhiy Storchaka 7e7a3dba5f Issue #23865: close() methods in multiple modules now are idempotent and more
robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
2015-04-10 13:24:41 +03:00
doko@ubuntu.com f172caeb8b - fix file permission for Lib/test/test_script_helper.py 2015-04-12 02:03:50 +02:00
Guido van Rossum 0ac8aa7ff3 Unittest for Issue 21511 by Christie Wilson bobcatfish@gmail.com (merge from 3.4). 2015-04-11 17:45:56 -04:00
Ethan Furman 3323da92e7 Issue23826: fix doc test for -OO runs 2015-04-11 09:39:59 -07:00
Antoine Pitrou 2dbc6e6bce Issue #23529: Limit the size of decompressed data when reading from
GzipFile, BZ2File or LZMAFile.  This defeats denial of service attacks
using compressed bombs (i.e. compressed payloads which decompress to a huge
size).

Patch by Martin Panter and Nikolaus Rath.
2015-04-11 00:31:01 +02:00
Serhiy Storchaka 056eb967ee Merge heads 2015-04-10 16:18:58 +03:00
Serhiy Storchaka 71fd224af0 Issue #21859: Added Python implementation of io.FileIO. 2015-04-10 16:16:16 +03:00
Berker Peksag 82c920c59e Issue #23062: Add a test for suppressing --version with argparse.SUPPRESS.
TestHelpVersionOptional was redundant.
2015-04-10 16:11:45 +03:00
Serhiy Storchaka 2116b12da5 Issue #23865: close() methods in multiple modules now are idempotent and more
robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
2015-04-10 13:29:28 +03:00
Serhiy Storchaka 1c5e281df8 Use assertRaisesRegex instead of deprecated assertRaisesRegexp. 2015-04-10 12:54:19 +03:00
Serhiy Storchaka 93da9b5e57 Use assertRaisesRegex instead of deprecated assertRaisesRegexp. 2015-04-10 12:52:09 +03:00
Berker Peksag 7ecfc82edb Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not available.
Patch by Davin Potts.
2015-04-08 17:56:30 +03:00
Berker Peksag 52c0c3382d Skip nntplib tests when transient errors captured. 2015-04-08 11:24:27 +03:00
Victor Stinner c9d11c341e Issue #23879, asyncio: SelectorEventLoop.sock_connect() must not call connect()
again if the first call to connect() raises an InterruptedError.

When the C function connect() fails with EINTR, the connection runs in
background. We have to wait until the socket becomes writable to be notified
when the connection succeed or fails.
2015-04-07 21:38:04 +02:00
Benjamin Peterson 033c58ad97 remove smtpd dead code (closes #23873)
Patch by Hoolean.
2015-04-07 11:59:06 -04:00
Donald Stufft b32fb8d274 Update pip to 6.1.1 2015-04-07 07:09:59 -04:00
Victor Stinner 4bea461572 Issue #23881: ftp://gatekeeper.research.compaq.com/ and ftp://ftp.debian.org/
are down, don't use anymore in test_urllib2net
2015-04-07 12:52:50 +02:00
Victor Stinner ab73e65032 Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if
the FTP connection failed to fix a ResourceWarning.
2015-04-07 12:49:27 +02:00
Donald Stufft fe508d1592 Upgrade pip to 6.1.0 and setuptools to 15.0 2015-04-07 01:29:33 -04:00
Serhiy Storchaka 6fbeae406e Issue #22977: Remove unconditional import of ctypes. 2015-04-06 20:37:16 +03:00
Berker Peksag 291d7b0284 Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not available.
Patch by Davin Potts.
2015-04-08 17:57:44 +03:00
Berker Peksag b8e973f937 Issue #23027: test_warnings now passes all tests when run it with -Werror. 2015-04-08 17:38:39 +03:00
Berker Peksag d09620839c Skip nntplib tests when transient errors captured. 2015-04-08 11:24:51 +03:00
Berker Peksag 716b3d3e91 Issue #23883: Add missing entries to traceback.__all__. 2015-04-08 09:47:14 +03:00
Gregory P. Smith cb6fdf2c63 issue10838: Rename the subprocess.mswindows internal global to _mswindows.
It is internal only, not a documented API.
2015-04-07 16:11:33 -07:00
Gregory P. Smith ace55865c5 Addresses Issue #10838: The subprocess now module includes
SubprocessError and TimeoutError in its list of exported names for the
users wild enough to use "from subprocess import *".

MAXFD, mswindows and list2cmdline should be dealt with (renamed or
moved) in separate commits.

Committed at 35,000ft.  Thanks chromebook free gogo wifi passes!
2015-04-07 15:57:54 -07:00
Victor Stinner 3c28878e40 Merge 3.4 (asyncio) 2015-04-07 21:38:36 +02:00
Serhiy Storchaka 1515450440 Issue #23411: Added DefragResult, ParseResult, SplitResult, DefragResultBytes,
ParseResultBytes, and SplitResultBytes to urllib.parse.__all__.
Patch by Martin Panter.
2015-04-07 19:09:01 +03:00
Benjamin Peterson 43a1bed3d2 merge 3.4 (#23873) 2015-04-07 12:00:37 -04:00
Donald Stufft 62f5278854 update pip to 6.1.1 2015-04-07 07:10:38 -04:00
Victor Stinner 388bf30fe8 Merge 3.4 (test_urllib2net) 2015-04-07 12:53:07 +02:00
Victor Stinner a9dd680d23 (Merge 3.4) Issue #23881: urllib.request.ftpwrapper constructor now closes the
socket if the FTP connection failed to fix a ResourceWarning.
2015-04-07 12:50:24 +02:00
Donald Stufft 9bcbdb40da Merged update of pip to 6.1.0 and setuptools to 15.0 2015-04-07 01:30:33 -04:00
Serhiy Storchaka 62aa7dc7c9 Issue #22721: An order of multiline pprint output of set or dict containing
orderable and non-orderable elements no longer depends on iteration order of
set or dict.
2015-04-06 22:52:44 +03:00
Serhiy Storchaka 01362da7d0 Issue #22977: Remove unconditional import of ctypes. 2015-04-06 20:37:34 +03:00
R David Murray cae7bdb424 #3566: Clean up handling of remote server disconnects.
This changeset does two things: introduces a new RemoteDisconnected exception
(that subclasses ConnectionResetError and BadStatusLine) so that a remote
server disconnection can be detected by client code (and provides a better
error message for debugging purposes), and ensures that the client socket is
closed if a ConnectionError happens, so that the automatic re-connection code
can work if the application handles the error and continues on.

Tests are added that confirm that a connection is re-used or not re-used
as appropriate to the various combinations of protocol version and headers.

Patch by Martin Panter, reviewed by Demian Brecht.  (Tweaked only slightly by
me.)
2015-04-05 19:26:29 -04:00
Benjamin Peterson 142bf565b4 merge 3.4 (#23872) 2015-04-05 10:03:23 -04:00
Benjamin Peterson 0c803319b0 fix extended command syntax (closes #23872) 2015-04-05 10:01:48 -04:00
Serhiy Storchaka de1c27feaa Issue #23466: Fixed expected error message in test_format. 2015-04-04 17:29:28 +03:00
Serhiy Storchaka b599ca8cff Fixed test_enum for issue #15582. 2015-04-04 12:48:04 +03:00
Serhiy Storchaka 06e66108c6 Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always
returns bool.  tkinter.BooleanVar now validates input values (accepted bool,
int, str, and Tcl_Obj).  tkinter.BooleanVar.get() now always returns bool.
2015-04-04 12:44:30 +03:00
Serhiy Storchaka 9a6e201f7d Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always
returns bool.  tkinter.BooleanVar now validates input values (accepted bool,
int, str, and Tcl_Obj).  tkinter.BooleanVar.get() now always returns bool.
2015-04-04 12:43:01 +03:00
Serhiy Storchaka 46ba6c8563 Issue #22831: Use "with" to avoid possible fd leaks. 2015-04-04 11:01:02 +03:00
Serhiy Storchaka ae2d667ae8 Open files in binary mode to avoid newlines transformation. 2015-04-04 10:36:50 +03:00
Serhiy Storchaka c9ba38c21c Open files in binary mode to avoid newlines transformation. 2015-04-04 10:36:25 +03:00
Serhiy Storchaka 778db289b5 Issue #10590: xml.sax.parseString() now supports string argument. 2015-04-04 10:12:26 +03:00
Serhiy Storchaka a110eb4331 Issue #23825: Fixed test_idle under -OO. 2015-04-04 09:48:17 +03:00
Serhiy Storchaka 9fa84b202e Issue #23825: Fixed test_idle under -OO. 2015-04-04 09:47:31 +03:00
Serhiy Storchaka 5cf2b7253d Issue #15582: inspect.getdoc() now follows inheritance chains. 2015-04-03 22:38:53 +03:00
Serhiy Storchaka 41525e31a5 Issue #23466: Raised OverflowError if %c argument is out of range. 2015-04-03 20:53:46 +03:00
Serhiy Storchaka 50ef0f41af Escaped backslashes in docstrings. 2015-04-03 18:13:23 +03:00
Serhiy Storchaka 9f8a8910a4 Escaped backslashes in docstrings. 2015-04-03 18:12:41 +03:00
Serhiy Storchaka 4deb950e2b Issue #22351. MockSslTests tests in test_nntplib now are reported if skipped. 2015-04-03 15:02:40 +03:00
Serhiy Storchaka 807743403d Issue #22351. MockSslTests tests in test_nntplib now are reported if skipped. 2015-04-03 15:02:20 +03:00
Victor Stinner 8c9bba07d4 Issue #22351: Fix test_nntplib if the ssl module is missing
@unittest.skipUnless(ssl, '...') doesn't work because the class body uses the
nntplib.NNTP_SSL attribute which doesn't exist.
2015-04-03 11:06:40 +02:00
Serhiy Storchaka 13e41c516a Issue #10590: Added tests for xml.sax.parse() and xml.sax.parseString(). 2015-04-02 23:05:57 +03:00
Victor Stinner 13019fdef3 Issue #22117: Add a new _PyTime_FromSeconds() function
Fix also _Py_InitializeEx_Private(): initialize time before initializing
import, import_init() uses the _PyTime API (for thread locks).
2015-04-03 13:10:54 +02:00
Victor Stinner 21dfffa218 Merge 3.4 (test_nntplib) 2015-04-03 11:09:08 +02:00
Serhiy Storchaka f1468eb44c Issue #10590: Added tests for xml.sax.parse() and xml.sax.parseString(). 2015-04-02 23:07:19 +03:00
Serhiy Storchaka 61de087f0f Issue #2175: SAX parsers now support a character stream of InputSource object. 2015-04-02 21:00:13 +03:00
Serhiy Storchaka 278ba2690c Issue #2175: Added tests for xml.sax.saxutils.prepare_input_source().
Made test XML files non-ASCII.
2015-04-02 20:57:20 +03:00
Serhiy Storchaka aa9563c1b8 Issue #2175: Added tests for xml.sax.saxutils.prepare_input_source().
Made test XML files non-ASCII.
2015-04-02 20:55:59 +03:00
Serhiy Storchaka b162914158 Issue #16840: Fixed test_tcl for Tcl < 8.5. 2015-04-02 20:07:24 +03:00
Serhiy Storchaka 2379d541dd Issue #16840: Fixed test_tcl for Tcl < 8.5. 2015-04-02 20:07:09 +03:00
Serhiy Storchaka 9fe562b499 Issue #21526: Skip test_booleans on Tcl < 8.5. 2015-04-02 19:59:34 +03:00
Serhiy Storchaka a5a4bd76fb Issue #21526: Skip test_booleans on Tcl < 8.5. 2015-04-02 19:57:52 +03:00
Serhiy Storchaka 4c7dc48ea5 Issue #16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and
arbitrary precision integers added in Tcl 8.5.
2015-04-02 18:49:14 +03:00
Serhiy Storchaka ea134da929 Issue #16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and
arbitrary precision integers added in Tcl 8.5.
2015-04-02 18:46:50 +03:00
Victor Stinner 39c0721d7b Merge 3.4 (test_exceptions) 2015-04-02 14:22:44 +02:00
Victor Stinner d223fa631d Issue #22977: Fix test_exceptions 2015-04-02 14:17:38 +02:00
Serhiy Storchaka b7616621db Issue #21526: Fixed the test_booleans test for wantobjects = 0. 2015-04-02 11:47:51 +03:00
Serhiy Storchaka 9171fe5a1d Issue #21526: Fixed the test_booleans test for wantobjects = 0. 2015-04-02 11:46:07 +03:00
Serhiy Storchaka b452f41cc8 Issue #21526: Fixed support of new boolean type in Tcl 8.5. 2015-04-02 10:58:40 +03:00
Serhiy Storchaka f7de3dd02d Issue #21526: Tkinter now supports new boolean type in Tcl 8.5. 2015-04-02 10:35:57 +03:00
Serhiy Storchaka 1399a01b90 Issue #22977: Fixed formatting Windows error messages on Wine.
Patch by Martin Panter.
2015-04-02 09:50:06 +03:00
Serhiy Storchaka f41f8f9974 Issue #22977: Fixed formatting Windows error messages on Wine.
Patch by Martin Panter.
2015-04-02 09:47:27 +03:00
Benjamin Peterson 4b9df0d33b merge 3.4 (#23844) 2015-04-02 00:08:10 -04:00
Benjamin Peterson a7eaf56a6d replace 512 bit dh key with a 2014 bit one (closes #23844)
Patch by Cédric Krier.
2015-04-02 00:04:06 -04:00
Victor Stinner 62d1c70eff Issue #22117, issue #23485: Fix _PyTime_AsMilliseconds() and
_PyTime_AsMicroseconds() rounding.

Add also unit tests.
2015-04-01 17:47:07 +02:00
Raymond Hettinger 067bbba7a4 Check deques against common sequence tests (except for slicing). 2015-04-01 08:11:09 -07:00
Serhiy Storchaka c19c3960bb Issue #23821: Fixed test_pdb failure under -O. 2015-04-01 16:58:39 +03:00
Serhiy Storchaka a16de5dbf5 Issue #23821: Fixed test_pdb failure under -O. 2015-04-01 16:58:19 +03:00
Serhiy Storchaka 05ddbf0875 Issue #23838: linecache now clears the cache and returns an empty result on
MemoryError.
2015-04-01 16:56:13 +03:00
Serhiy Storchaka c512adc90d Issue #23838: linecache now clears the cache and returns an empty result on
MemoryError.
2015-04-01 16:54:05 +03:00
Serhiy Storchaka c05e260ecb Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
2015-04-01 13:06:18 +03:00
Serhiy Storchaka 263dcd20a3 Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
2015-04-01 13:01:14 +03:00