]> granicus.if.org Git - python/commitdiff
#13899: merge with 3.2.
authorEzio Melotti <ezio.melotti@gmail.com>
Fri, 11 Jan 2013 06:43:53 +0000 (08:43 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Fri, 11 Jan 2013 06:43:53 +0000 (08:43 +0200)
1  2 
Lib/sre_parse.py
Lib/test/test_re.py
Misc/NEWS

Simple merge
index b945203633df8307906e1eb2adce4e0fbe878371,6b047e48dbb7fa2432fe4d277a50b39e9b2a0f17..feae7c55075c350913c588fa97d880acd50c029a
@@@ -949,7 -857,13 +949,13 @@@ class ReTests(unittest.TestCase)
          # Test behaviour when not given a string or pattern as parameter
          self.assertRaises(TypeError, re.compile, 0)
  
 -    @bigmemtest(size=_2G, memuse=character_size)
+     def test_bug_13899(self):
+         # Issue #13899: re pattern r"[\A]" should work like "A" but matches
+         # nothing. Ditto B and Z.
+         self.assertEqual(re.findall(r'[\A\B\b\C\Z]', 'AB\bCZ'),
+                          ['A', 'B', '\b', 'C', 'Z'])
 +    @bigmemtest(size=_2G, memuse=1)
      def test_large_search(self, size):
          # Issue #10182: indices were 32-bit-truncated.
          s = 'a' * size
diff --cc Misc/NEWS
index 1d12d263d039d7ef5619fe2ccdcf6b16d0de2a58,91706c1e6b6d1ac362fb946ff052348773939d35..1633879cd3c74faf834af2450ec0ca5f8b931c14
+++ b/Misc/NEWS
@@@ -142,8 -199,9 +142,11 @@@ Core and Builtin
  Library
  -------
  
 +- Issue #16900: Issue a ResourceWarning when an ssl socket is left unclosed.
 +
+ - Issue #13899: \A, \Z, and \B now correctly match the A, Z, and B literals
+   when used inside character classes (e.g. '[\A]').  Patch by Matthew Barnett.
  - Issue #15545: Fix regression in sqlite3's iterdump method where it was
    failing if the connection used a row factory (such as sqlite3.Row) that
    produced unsortable objects. (Regression was introduced by fix for 9750).