List of commits:
Subject Hash Author Date (UTC)
bpo-30320: test_eintr now uses pthread_sigmask() (#1523) 211a392cc15f9a7b1b8ce65d8f6c9f8237d1b77f Victor Stinner 2017-05-10 00:37:42
PCbuild/build.bat: pass command line parameters when building PGO (#1510) 291557e2904fa149ee3d56142f41acf63c47fea3 Charles 2017-05-09 21:58:48
bpo-30285: Optimize case-insensitive matching and searching (#1482) 6d336a027913327fc042b0d758a16724fea27b9c Serhiy Storchaka 2017-05-09 20:37:14
bpo-30024: Circular imports involving absolute imports with binding (#1264) f93234bb8a87855f295d441524e519481ce6ab13 Serhiy Storchaka 2017-05-09 19:31:05
bpo-30273: update distutils.sysconfig for venv's created from Python (#1515) dbdea629e2e0e4bd8845aa55041e0a0ca4172cf3 Jeremy Kloth 2017-05-09 15:24:13
bpo-30258: regrtest: Fix run_tests_multiprocess() (#1479) 74683fc6247c522ae955a6e7308b8ff51def35d8 Victor Stinner 2017-05-09 09:34:01
bpo-29990: Fix range checking in GB18030 decoder (#1495) 9da408d15bdef624a5632182cb4edf98001fa82f Xiang Zhang 2017-05-09 03:38:32
bpo-30289: remove Misc/python-config.sh when make distclean (#1498) fa5abac1e6cd74979557d5a6f960a55f40a10b0e Xiang Zhang 2017-05-09 02:32:13
bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991) cc3fa204d357be5fafc10eb8c2a80fe0bca998f1 Pierre Quentel 2017-05-08 12:08:34
Fix a trivial typo in global section (#1497) f34c6850203a2406c4950af7a9c8a134145df4ea Jim Fasarakis-Hilliard 2017-05-08 11:36:29
Closes bpo-30168: indent methods in Logger Class (#1295) 55ace65eba587fe3cf3759a43cccf85214651971 Jim Fasarakis-Hilliard 2017-05-07 18:40:18
Revert bpo-26293 for zipfile breakage. See also bpo-29094. (#1484) 3763ea865cee5bbabcce11cd577811135e0fc747 Serhiy Storchaka 2017-05-06 11:46:01
bpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367) a12df7b7d40dbf47825917c8fa03d2c09b5a382c Jelle Zijlstra 2017-05-05 21:27:12
bpo-29243: Fix Makefile with respect to --enable-optimizations (#1478) a1054c3b0037d4c2a5492e79fc193f36245366c7 torsava 2017-05-05 15:35:50
bpo-29920: Document cgitb.text() and cgitb.html() functions (GH-849) c07b3a15be5e0a68a73b4c532861ed8de6932bd2 masklinn 2017-05-05 08:15:12
bpo-30279: Remove unused Python/thread_foobar.h (#1473) fdaeea620f8c78da89cddba4ab010c64535800e0 Masayuki Yamamoto 2017-05-05 08:04:13
bpo-30264: ExpatParser closes the source on error (#1451) ef9c0e732fc50aefbdd7c5a80e04e14b31684e66 Victor Stinner 2017-05-05 07:46:47
bpo-30277: Replace _sre.getlower() with _sre.ascii_tolower() and _sre.unicode_tolower(). (#1468) 7186cc29be352bed6f1110873283d073fd0643e4 Serhiy Storchaka 2017-05-05 07:42:46
bpo-30243: Fixed the possibility of a crash in _json. (#1420) 76a3e51a403bc84ed536921866c86dd7d07aaa7e Serhiy Storchaka 2017-05-05 07:08:49
bpo-30215: Make re.compile() locale agnostic. (#1361) 898ff03e1e7925ecde3da66327d3cdc7e07625ba Serhiy Storchaka 2017-05-05 05:53:40
Commit 211a392cc15f9a7b1b8ce65d8f6c9f8237d1b77f - bpo-30320: test_eintr now uses pthread_sigmask() (#1523)
Rewrite sigwaitinfo() and sigtimedwait() unit tests for EINTR using
pthread_sigmask() to fix a race condition between the child and the
parent process.

Remove the pipe which was used as a weak workaround against the race
condition.

sigtimedwait() is now tested with a child process sending a signal
instead of testing the timeout feature which is more unstable
(especially regarding to clock resolution depending on the platform).
Author: Victor Stinner
Author date (UTC): 2017-05-10 00:37
Committer name: GitHub
Committer date (UTC): 2017-05-10 00:37
Parent(s): 291557e2904fa149ee3d56142f41acf63c47fea3
Signing key:
Tree: e00d3bce60207655ec5b229bb594d2a654f8dd6c
File Lines added Lines deleted
Lib/test/eintrdata/eintr_tester.py 26 35
File Lib/test/eintrdata/eintr_tester.py changed (mode: 100644) (index 74a509b99f..1dbe88efe7)
... ... class TimeEINTRTest(EINTRBaseTest):
371 371
372 372
373 373 @unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()") @unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
374 # bpo-30320: Need pthread_sigmask() to block the signal, otherwise the test
375 # is vulnerable to a race condition between the child and the parent processes.
376 @unittest.skipUnless(hasattr(signal, 'pthread_sigmask'),
377 'need signal.pthread_sigmask()')
374 378 class SignalEINTRTest(EINTRBaseTest): class SignalEINTRTest(EINTRBaseTest):
375 379 """ EINTR tests for the signal module. """ """ EINTR tests for the signal module. """
376 380
377 @unittest.skipUnless(hasattr(signal, 'sigtimedwait'),
378 'need signal.sigtimedwait()')
379 def test_sigtimedwait(self):
380 t0 = time.monotonic()
381 signal.sigtimedwait([signal.SIGUSR1], self.sleep_time)
382 dt = time.monotonic() - t0
383
384 if sys.platform.startswith('aix'):
385 # On AIX, sigtimedwait(0.2) sleeps 199.8 ms
386 self.assertGreaterEqual(dt, self.sleep_time * 0.9)
387 else:
388 self.assertGreaterEqual(dt, self.sleep_time)
389
390 @unittest.skipUnless(hasattr(signal, 'sigwaitinfo'),
391 'need signal.sigwaitinfo()')
392 def test_sigwaitinfo(self):
393 # Issue #25277, #25868: give a few milliseconds to the parent process
394 # between os.write() and signal.sigwaitinfo() to works around a race
395 # condition
396 self.sleep_time = 0.100
397
381 def check_sigwait(self, wait_func):
398 382 signum = signal.SIGUSR1 signum = signal.SIGUSR1
399 383 pid = os.getpid() pid = os.getpid()
400 384
401 385 old_handler = signal.signal(signum, lambda *args: None) old_handler = signal.signal(signum, lambda *args: None)
402 386 self.addCleanup(signal.signal, signum, old_handler) self.addCleanup(signal.signal, signum, old_handler)
403 387
404 rpipe, wpipe = os.pipe()
405
406 388 code = '\n'.join(( code = '\n'.join((
407 389 'import os, time', 'import os, time',
408 390 'pid = %s' % os.getpid(), 'pid = %s' % os.getpid(),
409 391 'signum = %s' % int(signum), 'signum = %s' % int(signum),
410 392 'sleep_time = %r' % self.sleep_time, 'sleep_time = %r' % self.sleep_time,
411 'rpipe = %r' % rpipe,
412 'os.read(rpipe, 1)',
413 'os.close(rpipe)',
414 393 'time.sleep(sleep_time)', 'time.sleep(sleep_time)',
415 394 'os.kill(pid, signum)', 'os.kill(pid, signum)',
416 395 )) ))
417 396
397 old_mask = signal.pthread_sigmask(signal.SIG_BLOCK, [signum])
398 self.addCleanup(signal.pthread_sigmask, signal.SIG_UNBLOCK, [signum])
399
418 400 t0 = time.monotonic() t0 = time.monotonic()
419 proc = self.subprocess(code, pass_fds=(rpipe,))
420 os.close(rpipe)
401 proc = self.subprocess(code)
421 402 with kill_on_error(proc): with kill_on_error(proc):
422 # sync child-parent
423 os.write(wpipe, b'x')
424 os.close(wpipe)
403 wait_func(signum)
404 dt = time.monotonic() - t0
405
406 self.assertEqual(proc.wait(), 0)
425 407
426 # parent
408 @unittest.skipUnless(hasattr(signal, 'sigwaitinfo'),
409 'need signal.sigwaitinfo()')
410 def test_sigwaitinfo(self):
411 def wait_func(signum):
427 412 signal.sigwaitinfo([signum]) signal.sigwaitinfo([signum])
428 dt = time.monotonic() - t0
429 self.assertEqual(proc.wait(), 0)
430 413
431 self.assertGreaterEqual(dt, self.sleep_time)
414 self.check_sigwait(wait_func)
415
416 @unittest.skipUnless(hasattr(signal, 'sigtimedwait'),
417 'need signal.sigwaitinfo()')
418 def test_sigtimedwait(self):
419 def wait_func(signum):
420 signal.sigtimedwait([signum], 120.0)
421
422 self.check_sigwait(wait_func)
432 423
433 424
434 425 @unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()") @unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using git:
git clone git://git.rocketgit.com/user/benf_wspdigital/cpython

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main