Commit Graph

99439 Commits

Author SHA1 Message Date
Jonathan Eunice 7a801839e9 bpo-30620: Remove dead lines from textwrap.dedent (GH-2064) 2017-06-15 19:19:43 -07:00
Jonathan Eunice 214f7eed76 bpo-30603: add tests to textwrap.dedent (GH-2206)
* test dedent with declining indent level
* add textwrap.dedent test cases
2017-06-15 19:18:54 -07:00
Victor Stinner 258bfc462b bpo-30673: test.bat: add -t option (timeout) (#2211) 2017-06-15 20:19:45 +02:00
Serhiy Storchaka 145541cfa0 bpo-30626: Fix error handling in PyImport_Import(). (#2103)
In rare circumstances PyImport_Import() could return NULL without raising
an error.
2017-06-15 20:54:38 +03:00
Sylvain 96c7c06850 bpo-20627: Fix error message when keyword arguments are used (#2115) 2017-06-15 18:05:23 +03:00
Victor Stinner 8acb4cf2b3 bpo-30602: Fix refleak in os.spawnv() (#2212)
When os.spawnv() fails while handling arguments, free correctly
argvlist: pass lastarg+1 rather than lastarg to free_string_array()
to also free the first item.
2017-06-15 15:30:40 +02:00
Nick Coghlan 7926516ff9 bpo-28180: Standard stream & FS encoding differ on Mac OS X (GH-2208)
In the C locale on Mac OS X, the default filesystem encoding
used for operating system interfaces is UTF-8, but the
default encoding used on the standard streams is still ASCII.

Setting the POSIX locale also behaves differently from setting
other locales on Mac OS X, so skip that in the test suite for now.
2017-06-15 19:11:39 +10:00
Victor Stinner 23ec4b57e1 bpo-29591: Upgrade Modules/expat to libexpat 2.2 (#2164)
* bpo-29591: Upgrade Modules/expat to libexpat 2.2

* bpo-29591: Restore Python changes on expat

* bpo-29591: Remove expat config of unsupported platforms

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

* Amiga
* MacOS Classic on PPC32
* Open Watcom

* bpo-29591: Remove useless XML_HAS_SET_HASH_SALT

The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became
useless since our local expat copy was upgrade to expat 2.1 (it's now
expat 2.2.0).
2017-06-15 00:54:36 +02:00
Victor Stinner f7e07840d7 bpo-30284: Fix regrtest for out of tree build (#1481)
Use a build/ directory in the build directory, not in the source
directory, since the source directory may be read-only and must not
be modified.

Fallback on the source directory if the build directory is not
available (missing "abs_builddir" sysconfig variable).
2017-06-15 00:44:05 +02:00
Milan Oberkirch 8c3f05e9f0 bpo-30436: Raise ModuleNotFoundError for importlib.util.find_spec() when parent isn't a package (GH-1899)
Previously AttributeError was raised, but that's not very reflective of the fact that the requested module can't be found since the specified parent isn't actually a package.
2017-06-14 14:34:50 -07:00
terryjreedy 32fd874afe bpo-15786: Fix IDLE autocomplete return problem. (#2198)
Before, <return> would not, for instance, complete 're.c' to 're.compile' even with 'compile' highlighted.  Now it does.  Before, <return> was inserted into text, which in Shell meant compile() and possibly execute.  Now cursor is left after completion.
2017-06-14 15:43:15 -04:00
Victor Stinner b18563da88 bpo-30231: Remove skipped test_imaplib tests (#1419)
The public cyrus.andrew.cmu.edu IMAP server (port 993) doesn't accept
TLS connection using our self-signed x509 certificate. Remove the two
tests which are already skipped.

Write a new test_certfile_arg_warn() unit test for the certfile
deprecation warning.
2017-06-14 18:48:32 +02:00
mlouielu 778b484145 bpo-15786: IDLE: Fix mouse clicks on autocompletetion window (#1811)
The root problem was non-check for hide_event. When user clicks
on autocomplete window (acw), root widget gets focusOut event, then triggers hide_window to
close the acw. It should only be hide when acw is active, and acw didn't
get focus at FocusOut event (this event bind on acw and widget), or when
widget get a ButtonPress event (this event only bind on widget).

MacOS  froze after double click on acw because when
doubleclick_event try to hide window at the end, hide_window function
destory whole acw, but tkinter didn't get focus back to widget. So set focus
on widget first, then destory acw.

Windows could not respond on double click event, because of the misbehavior
of Configure event.  When acw was shown, tkinter called winconfig
event multiple times.  That caused tkinter to not response to double
click event.  When on Windows, unbind Configure event first
time get into winconfig_event to prevent multiple call of this event.
2017-06-14 11:13:19 -04:00
csabella 4ebf03d109 Fix trivial typo in Readme (GH-2185)
Replace platform with platforms.
2017-06-14 06:32:06 -07:00
Victor Stinner 526b22657c bpo-30602: Fix refleak in os.spawnve() (#2184)
When os.spawnve() fails while handling arguments, free correctly
argvlist: pass lastarg+1 rather than lastarg to free_string_array()
to also free the first item.
2017-06-14 14:26:21 +02:00
Victor Stinner 3402f72688 bpo-30649: Revert utime delta in test_os (#2176)
PPC64 Fedora 3.x buildbot requires at least a delta of 14 ms: revert
the utime delta to 20 ms.

I tried 10 ms, but test_os failed on the PPC64 Fedora 3.x buildbot.
2017-06-14 11:55:17 +02:00
terryjreedy 188aedf8bb bpo-25514: Improve IDLE's connection refused message (#2177)
When IDLE fail to start because the socket connection fails, direct people to a new subsection of the IDLE doc listing various causes and remedies.
2017-06-13 21:32:16 -04:00
Victor Stinner 8f6eeaf21c bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (#2148)
_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.
2017-06-13 23:48:47 +02:00
Victor Stinner c94caca65c bpo-30649: test_os tolerates 50 ms delta for utime (#2156)
On Windows, tolerate a delta of 50 ms instead of 20 ms in
test_utime_current() and test_utime_current_old() of test_os.

On other platforms, reduce the delta from 20 ms to 10 ms.
2017-06-13 23:48:27 +02:00
Ben Hoyt 184bd82ba8 bpo-30659 : Use ** for kwargs in namedtuple._replace() signature (GH-2173) 2017-06-13 12:20:51 -07:00
Jonathan Eunice 601483d3b8 bpo-30603: Add test case to textwrap.dedent (GH-2014) 2017-06-13 12:04:10 -07:00
terryjreedy 049cf2bb44 bpo-27922: Stop gui flash from idle_test.test_parenmatch (#2171)
For unknown reasons, this does not work when running leak tests.
2017-06-13 14:40:10 -04:00
Emily Morehouse 2d0afef82a bpo-30656: Fix Python C API Module Objects documentation (GH-2170)
`PyModule_New()` now refers to `PyModule_NewObject()`
2017-06-13 10:58:18 -07:00
Sanyam Khurana b9c3da5c89 bpo-24744: Raises error in pkgutil.walk_packages if path is str (#1926)
bpo-24744: Raise error in pkgutil.walk_packages if path is str

Previously an empty result list was accidentallly returned, since the
code iterated over the string as if it were the expected list of paths,
and of course found nothing.
2017-06-13 13:11:14 -04:00
Antoine Pitrou 1eb6c0074d bpo-24484: Avoid race condition in multiprocessing cleanup (#2159)
* bpo-24484: Avoid race condition in multiprocessing cleanup

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

* Use test.support.start_threads()

* Add Misc/NEWS
2017-06-13 17:10:39 +02:00
terryjreedy 8323189ff1 Fix ref leak in idle_test.test_macosx (#2163) 2017-06-13 10:52:29 -04:00
messi Liao 0d322181d9 bpo-30650: Fixed a syntax error: missed right parentheses (#2154) 2017-06-13 17:30:43 +03:00
Nick Coghlan 4563099d28 bpo-28180: assume UTF-8 for Mac OS X PEP 538 tests (GH-2130) 2017-06-13 22:49:44 +10:00
mlouielu b070fd275b bpo-30642: IDLE: Fix test_query refleak (#2147)
Patch by Louie Lu.
2017-06-13 08:29:44 -04:00
Victor Stinner 023564bf7d bpo-30635: Fix refleak in test_c_locale_coercion (#2126)
When checking for reference leaks, test_c_locale_coercion is run
multiple times and so _LocaleCoercionTargetsTestCase.setUpClass() is
called multiple times. setUpClass() appends new value at each call,
so it looks like a reference leak.

Moving the setup from setUpClass() to setUpModule() avoids
this, eliminating the false alarm.
2017-06-13 21:32:31 +10:00
Victor Stinner eb52ac8992 bpo-28180: Fix test_capi.test_forced_io_encoding() (#2155)
Don't run Python in an empty environment, but copy the current
environment and set PYTHONIOENCODING. So the test works also on
Python compiled in shared mode (using libpython).
2017-06-13 11:49:44 +02:00
Antoine Pitrou d79c1d4a94 Mention how to disable signal fd wakeup (#2140) 2017-06-13 10:14:09 +02:00
Antoine Pitrou 2b5cc5ebaf bpo-30643: Fix race condition in signal wakeup in forkserver (followup to PR #1989) (#2139)
* Fix race condition in signal wakeup in forkserver (followup to PR #1989)

There's an admittedly well-known race condition where ECHILD can arrive
just before the C function epoll_wait() and the latter wouldn't therefore
return EINTR.  The solution is to use set_wakeup_fd(), which was designed
to avoid such race conditions.

* Reset wakeup fd in child
2017-06-13 09:46:06 +02:00
Andrew Kuchling bd4e9e0ca9 bpo-6519: Improve Python Input Output Tutorial (GH-2143)
Move up the discussion about 'with' keyword, so it appears earlier in the document.
2017-06-12 22:31:01 -07:00
Stéphane Wirtel 81f67b6f48 bpo-30636: Fix the indentation for the help (#2131) 2017-06-13 11:31:11 +10:00
Antoine Pietri a77a35d70b bpo-30177: add NEWS entry (#2135) 2017-06-12 12:40:13 -04:00
Antoine Pitrou dfd5f34634 Fix bpo-30589: improve Process.exitcode with forkserver (#1989)
* Fix bpo-30589: improve Process.exitcode with forkserver

When the child is killed, Process.exitcode should return -signum, not 255.

* Add Misc/NEWS
2017-06-12 15:28:19 +02:00
Giampaolo Rodola ced36a993f bpo-30624 remaining bare except (#2108)
bpo-30624 / selectors: use bare 'except' clause instead of 'except
Exception'
2017-06-12 14:43:40 +02:00
Stéphane Wirtel 7d1017d9ed bpo-30636: Add PYTHONCOERCECLOCALE to the help of the command line (GH-2125) 2017-06-12 21:30:33 +10:00
mircea-cosbuc b459f74826 [email] bpo-29478: Fix passing max_line_length=None from Compat32 policy (GH-595)
If max_line_length=None is specified while using the Compat32 policy,
it is no longer ignored.
2017-06-11 23:43:41 -07:00
Serhiy Storchaka 3fd54d4a7e bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (#2034)
The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
2017-06-12 08:25:04 +03:00
suketa 1dbce04d0e bpo-30621: Update Input Output Tutorial Example(GH-2074)
import json before using json module
2017-06-11 18:42:59 -07:00
Yury Selivanov 09663de203 Revert "bpo-29406: asyncio SSL contexts leak sockets after calling close with certain servers (#409)" (#2111)
This reverts commit a608d2d5a7.
2017-06-11 16:46:35 +02:00
Yury Selivanov 7ce1c6fb57 bpo-30508: Don't log exceptions if Task/Future "cancel()" method called (#2050) 2017-06-11 13:49:18 +00:00
Serhiy Storchaka 36ff451eba bpo-30501: Make the compiler producing optimized code for condition expressions. (#1851) 2017-06-11 14:50:22 +03:00
Serhiy Storchaka 1efbf92e90 bpo-11822: Improve disassembly to show embedded code objects. (#1844)
The depth argument limits recursion.
2017-06-11 14:09:39 +03:00
Benjamin Peterson fdfca5f0ff remove extra word (#2101) 2017-06-11 00:24:38 -07:00
Benjamin Peterson dc1da9adc3 clarify recv() and send() on SSLObject (#2100)
SSLObject has recv() and send(), but they don't do any network io.
2017-06-11 00:15:14 -07:00
Zachary Ware 3f8f16d102 Show what's changed when Travis fails regen check (GH-2095)
Also fixed a few more line endings that were missed in GH-840, which were causing failure.
2017-06-10 23:04:36 -05:00
Nick Coghlan 6ea4186de3 bpo-28180: Implementation for PEP 538 (#659)
- new PYTHONCOERCECLOCALE config setting
- coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default
- always uses C.UTF-8 on Android
- uses `surrogateescape` on stdin and stdout in the coercion
  target locales
- configure option to disable locale coercion at build time
- configure option to disable C locale warning at build time
2017-06-11 13:16:15 +10:00