Commit fda7445
authored
Return files and directories from `pathlib.Path.glob()` if the pattern ends
with `**`. This is more compatible with `PurePath.full_match()` and with
other glob implementations such as bash and `glob.glob()`. Users can add a
trailing slash to match only directories.
In my previous patch I added a `FutureWarning` with the intention of fixing
this in Python 3.15. Upon further reflection I think this was an
unnecessarily cautious remedy to a clear bug.
1 parent 6de8aa3 commit fda7445
File tree
6 files changed
+35
-23
lines changed- Doc
- library
- whatsnew
- Lib
- pathlib
- test/test_pathlib
- Misc/NEWS.d/next/Library
6 files changed
+35
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1038 | 1038 | | |
1039 | 1039 | | |
1040 | 1040 | | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
| 1041 | + | |
| 1042 | + | |
1044 | 1043 | | |
1045 | 1044 | | |
1046 | 1045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
353 | 358 | | |
354 | 359 | | |
355 | 360 | | |
| |||
1211 | 1216 | | |
1212 | 1217 | | |
1213 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1214 | 1224 | | |
1215 | 1225 | | |
1216 | 1226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | 468 | | |
477 | 469 | | |
478 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | 1261 | | |
1274 | 1262 | | |
1275 | 1263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1765 | 1765 | | |
1766 | 1766 | | |
1767 | 1767 | | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
1768 | 1773 | | |
1769 | 1774 | | |
1770 | 1775 | | |
1771 | 1776 | | |
1772 | 1777 | | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
1773 | 1782 | | |
1774 | 1783 | | |
1775 | 1784 | | |
1776 | 1785 | | |
1777 | 1786 | | |
| 1787 | + | |
1778 | 1788 | | |
1779 | 1789 | | |
1780 | 1790 | | |
| |||
1791 | 1801 | | |
1792 | 1802 | | |
1793 | 1803 | | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
1794 | 1809 | | |
1795 | 1810 | | |
| 1811 | + | |
1796 | 1812 | | |
1797 | 1813 | | |
1798 | 1814 | | |
| 1815 | + | |
1799 | 1816 | | |
| 1817 | + | |
1800 | 1818 | | |
1801 | 1819 | | |
1802 | 1820 | | |
| |||
1833 | 1851 | | |
1834 | 1852 | | |
1835 | 1853 | | |
| 1854 | + | |
1836 | 1855 | | |
1837 | 1856 | | |
1838 | 1857 | | |
1839 | 1858 | | |
| 1859 | + | |
| 1860 | + | |
1840 | 1861 | | |
1841 | 1862 | | |
1842 | 1863 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments