List of commits:
Subject Hash Author Date (UTC)
bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. (#1490) 305ccbe27ea5ba82fd2d8c32ec739f980e524330 Serhiy Storchaka 2017-05-10 03:05:20
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
Commit 305ccbe27ea5ba82fd2d8c32ec739f980e524330 - bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. (#1490)
Now allowed several subsequential inline modifiers at the start of the
pattern (e.g. '(?i)(?s)...'). In verbose mode whitespaces and comments
now are allowed before and between inline modifiers (e.g.
'(?x) (?i) (?s)...').
Author: Serhiy Storchaka
Author date (UTC): 2017-05-10 03:05
Committer name: GitHub
Committer date (UTC): 2017-05-10 03:05
Parent(s): 211a392cc15f9a7b1b8ce65d8f6c9f8237d1b77f
Signing key:
Tree: b2a5769d41b5de66dff278d57b2caa57b18d4f63
File Lines added Lines deleted
Lib/sre_parse.py 5 7
Lib/test/test_re.py 45 14
Misc/NEWS 6 0
File Lib/sre_parse.py changed (mode: 100644) (index ab37fd3fe2..d8d1bd552f)
... ... def _parse_sub(source, state, verbose, nested=True):
412 412 sourcematch = source.match sourcematch = source.match
413 413 start = source.tell() start = source.tell()
414 414 while True: while True:
415 itemsappend(_parse(source, state, verbose))
415 itemsappend(_parse(source, state, verbose, not nested and not items))
416 416 if not sourcematch("|"): if not sourcematch("|"):
417 417 break break
418 418
 
... ... def _parse_sub_cond(source, state, condgroup, verbose):
466 466 subpattern.append((GROUPREF_EXISTS, (condgroup, item_yes, item_no))) subpattern.append((GROUPREF_EXISTS, (condgroup, item_yes, item_no)))
467 467 return subpattern return subpattern
468 468
469 def _parse(source, state, verbose):
469 def _parse(source, state, verbose, first=False):
470 470 # parse a simple pattern # parse a simple pattern
471 471 subpattern = SubPattern(state) subpattern = SubPattern(state)
472 472
 
... ... def _parse(source, state, verbose):
730 730 state.checklookbehindgroup(condgroup, source) state.checklookbehindgroup(condgroup, source)
731 731 elif char in FLAGS or char == "-": elif char in FLAGS or char == "-":
732 732 # flags # flags
733 pos = source.pos
734 733 flags = _parse_flags(source, state, char) flags = _parse_flags(source, state, char)
735 734 if flags is None: # global flags if flags is None: # global flags
736 if pos != 3: # "(?x"
735 if not first or subpattern:
737 736 import warnings import warnings
738 737 warnings.warn( warnings.warn(
739 738 'Flags not at the start of the expression %s%s' % ( 'Flags not at the start of the expression %s%s' % (
 
... ... def _parse(source, state, verbose):
742 741 ), ),
743 742 DeprecationWarning, stacklevel=7 DeprecationWarning, stacklevel=7
744 743 ) )
744 if (state.flags & SRE_FLAG_VERBOSE) and not verbose:
745 raise Verbose
745 746 continue continue
746 747 add_flags, del_flags = flags add_flags, del_flags = flags
747 748 group = None group = None
 
... ... def _parse_flags(source, state, char):
795 796 msg = "unknown flag" if char.isalpha() else "missing -, : or )" msg = "unknown flag" if char.isalpha() else "missing -, : or )"
796 797 raise source.error(msg, len(char)) raise source.error(msg, len(char))
797 798 if char == ")": if char == ")":
798 if ((add_flags & SRE_FLAG_VERBOSE) and
799 not (state.flags & SRE_FLAG_VERBOSE)):
800 raise Verbose
801 799 state.flags |= add_flags state.flags |= add_flags
802 800 return None return None
803 801 if add_flags & GLOBAL_FLAGS: if add_flags & GLOBAL_FLAGS:
File Lib/test/test_re.py changed (mode: 100644) (index 3129f7e988..4d71eea517)
... ... class ReTests(unittest.TestCase):
1325 1325 upper_char = '\u1ea0' # Latin Capital Letter A with Dot Below upper_char = '\u1ea0' # Latin Capital Letter A with Dot Below
1326 1326 lower_char = '\u1ea1' # Latin Small Letter A with Dot Below lower_char = '\u1ea1' # Latin Small Letter A with Dot Below
1327 1327
1328 p = re.compile(upper_char, re.I | re.U)
1329 q = p.match(lower_char)
1328 p = re.compile('.' + upper_char, re.I | re.S)
1329 q = p.match('\n' + lower_char)
1330 1330 self.assertTrue(q) self.assertTrue(q)
1331 1331
1332 p = re.compile(lower_char, re.I | re.U)
1333 q = p.match(upper_char)
1332 p = re.compile('.' + lower_char, re.I | re.S)
1333 q = p.match('\n' + upper_char)
1334 1334 self.assertTrue(q) self.assertTrue(q)
1335 1335
1336 p = re.compile('(?i)' + upper_char, re.U)
1337 q = p.match(lower_char)
1336 p = re.compile('(?i).' + upper_char, re.S)
1337 q = p.match('\n' + lower_char)
1338 1338 self.assertTrue(q) self.assertTrue(q)
1339 1339
1340 p = re.compile('(?i)' + lower_char, re.U)
1341 q = p.match(upper_char)
1340 p = re.compile('(?i).' + lower_char, re.S)
1341 q = p.match('\n' + upper_char)
1342 1342 self.assertTrue(q) self.assertTrue(q)
1343 1343
1344 p = re.compile('(?iu)' + upper_char)
1345 q = p.match(lower_char)
1344 p = re.compile('(?is).' + upper_char)
1345 q = p.match('\n' + lower_char)
1346 1346 self.assertTrue(q) self.assertTrue(q)
1347 1347
1348 p = re.compile('(?iu)' + lower_char)
1349 q = p.match(upper_char)
1348 p = re.compile('(?is).' + lower_char)
1349 q = p.match('\n' + upper_char)
1350 1350 self.assertTrue(q) self.assertTrue(q)
1351 1351
1352 self.assertTrue(re.match('(?ixu) ' + upper_char, lower_char))
1353 self.assertTrue(re.match('(?ixu) ' + lower_char, upper_char))
1352 p = re.compile('(?s)(?i).' + upper_char)
1353 q = p.match('\n' + lower_char)
1354 self.assertTrue(q)
1355
1356 p = re.compile('(?s)(?i).' + lower_char)
1357 q = p.match('\n' + upper_char)
1358 self.assertTrue(q)
1359
1360 self.assertTrue(re.match('(?ix) ' + upper_char, lower_char))
1361 self.assertTrue(re.match('(?ix) ' + lower_char, upper_char))
1362 self.assertTrue(re.match(' (?i) ' + upper_char, lower_char, re.X))
1363 self.assertTrue(re.match('(?x) (?i) ' + upper_char, lower_char))
1364 self.assertTrue(re.match(' (?x) (?i) ' + upper_char, lower_char, re.X))
1354 1365
1355 1366 p = upper_char + '(?i)' p = upper_char + '(?i)'
1356 1367 with self.assertWarns(DeprecationWarning) as warns: with self.assertWarns(DeprecationWarning) as warns:
 
... ... class ReTests(unittest.TestCase):
1368 1379 'Flags not at the start of the expression %s (truncated)' % p[:20] 'Flags not at the start of the expression %s (truncated)' % p[:20]
1369 1380 ) )
1370 1381
1382 with self.assertWarns(DeprecationWarning):
1383 self.assertTrue(re.match('(?s).(?i)' + upper_char, '\n' + lower_char))
1384 with self.assertWarns(DeprecationWarning):
1385 self.assertTrue(re.match('(?i) ' + upper_char + ' (?x)', lower_char))
1386 with self.assertWarns(DeprecationWarning):
1387 self.assertTrue(re.match(' (?x) (?i) ' + upper_char, lower_char))
1388 with self.assertWarns(DeprecationWarning):
1389 self.assertTrue(re.match('^(?i)' + upper_char, lower_char))
1390 with self.assertWarns(DeprecationWarning):
1391 self.assertTrue(re.match('$|(?i)' + upper_char, lower_char))
1392 with self.assertWarns(DeprecationWarning):
1393 self.assertTrue(re.match('(?:(?i)' + upper_char + ')', lower_char))
1394 with self.assertWarns(DeprecationWarning):
1395 self.assertTrue(re.fullmatch('(^)?(?(1)(?i)' + upper_char + ')',
1396 lower_char))
1397 with self.assertWarns(DeprecationWarning):
1398 self.assertTrue(re.fullmatch('($)?(?(1)|(?i)' + upper_char + ')',
1399 lower_char))
1400
1401
1371 1402 def test_dollar_matches_twice(self): def test_dollar_matches_twice(self):
1372 1403 "$ matches the end of string, and just before the terminating \n" "$ matches the end of string, and just before the terminating \n"
1373 1404 pattern = re.compile('$') pattern = re.compile('$')
File Misc/NEWS changed (mode: 100644) (index 7a79521efd..997a03411d)
... ... Extension Modules
320 320 Library Library
321 321 ------- -------
322 322
323 - bpo-30298: Weaken the condition of deprecation warnings for inline modifiers.
324 Now allowed several subsequential inline modifiers at the start of the
325 pattern (e.g. ``'(?i)(?s)...'``). In verbose mode whitespaces and comments
326 now are allowed before and between inline modifiers (e.g.
327 ``'(?x) (?i) (?s)...'``).
328
323 329 - bpo-30285: Optimized case-insensitive matching and searching of regular - bpo-30285: Optimized case-insensitive matching and searching of regular
324 330 expressions. expressions.
325 331
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