Skip to content

Commit d1bfa7b

Browse files
committed
Merge branch 'fix-binascii-base32-padding' of https://github.com/ElDShell/cpython into fix-binascii-base32-padding
2 parents 5cf7ba7 + 64ee9ab commit d1bfa7b

10 files changed

Lines changed: 741 additions & 285 deletions

File tree

‎Doc/library/turtle.rst‎

Lines changed: 181 additions & 151 deletions
Large diffs are not rendered by default.

‎InternalDocs/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ Modules
6565
---
6666

6767
- [asyncio](asyncio.md)
68+
69+
- [fractions](fractions.md)

‎InternalDocs/fractions.md‎

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.

‎Lib/fractions.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ def limit_denominator(self, max_denominator=1000000):
402402
# proved that a rational number is a best upper or lower
403403
# approximation to x if, and only if, it is a convergent or
404404
# semiconvergent of the (unique shortest) continued fraction
405-
# associated to x.
405+
# associated to x. See e.g. Continued Fractions by A. Ya.
406+
# Khinchin (1964), Theorem 15.
406407
#
407408
# To find a best rational approximation with denominator <= M,
408409
# we find the best upper and lower approximations with

‎Lib/test/test_xml_etree.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4069,6 +4069,19 @@ def test_bad_find(self):
40694069
with self.assertRaisesRegex(SyntaxError, 'cannot use absolute path'):
40704070
e.findall('/tag')
40714071

4072+
def test_find_invalid_path(self):
4073+
e = ET.XML(SAMPLE_XML)
4074+
paths = ('@', './x=y', './(', './)', './]', './!=', './::',
4075+
'./()', "./'tag'", './"tag"', 'tag/@')
4076+
for obj in (e, ET.ElementTree(e)):
4077+
for method in ('find', 'findall', 'findtext', 'iterfind'):
4078+
for path in paths:
4079+
with self.subTest(type=type(obj).__name__,
4080+
method=method, path=path):
4081+
self.assertRaisesRegex(
4082+
SyntaxError, '^invalid path$',
4083+
getattr(obj, method), path)
4084+
40724085
def test_find_through_ElementTree(self):
40734086
e = ET.XML(SAMPLE_XML)
40744087
self.assertEqual(ET.ElementTree(e).find('tag').tag, 'tag')

0 commit comments

Comments
 (0)