Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4a208e44
Kaydet (Commit)
4a208e44
authored
Ock 30, 2016
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #23076: Path.glob() now raises a ValueError if it's called with an
invalid pattern. Patch by Thomas Nyberg.
üst
ef410770
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
0 deletions
+11
-0
pathlib.py
Lib/pathlib.py
+2
-0
test_pathlib.py
Lib/test/test_pathlib.py
+5
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/pathlib.py
Dosyayı görüntüle @
4a208e44
...
...
@@ -1065,6 +1065,8 @@ class Path(PurePath):
"""Iterate over this subtree and yield all existing files (of any
kind, including directories) matching the given pattern.
"""
if
not
pattern
:
raise
ValueError
(
"Unacceptable pattern: {!r}"
.
format
(
pattern
))
pattern
=
self
.
_flavour
.
casefold
(
pattern
)
drv
,
root
,
pattern_parts
=
self
.
_flavour
.
parse_parts
((
pattern
,))
if
drv
or
root
:
...
...
Lib/test/test_pathlib.py
Dosyayı görüntüle @
4a208e44
...
...
@@ -1969,6 +1969,11 @@ class PathTest(_BasePathTest, unittest.TestCase):
else
:
self
.
assertRaises
(
NotImplementedError
,
pathlib
.
WindowsPath
)
def
test_glob_empty_pattern
(
self
):
p
=
self
.
cls
()
with
self
.
assertRaisesRegex
(
ValueError
,
'Unacceptable pattern'
):
list
(
p
.
glob
(
''
))
@only_posix
class
PosixPathTest
(
_BasePathTest
,
unittest
.
TestCase
):
...
...
Misc/ACKS
Dosyayı görüntüle @
4a208e44
...
...
@@ -1038,6 +1038,7 @@ Neal Norwitz
Mikhail Novikov
Michal Nowikowski
Steffen Daode Nurpmeso
Thomas Nyberg
Nigel O'Brian
John O'Connor
Kevin O'Connor
...
...
Misc/NEWS
Dosyayı görüntüle @
4a208e44
...
...
@@ -73,6 +73,9 @@ Library
- Issue #26202: copy.deepcopy() now correctly copies range() objects with
non-atomic attributes.
- Issue #23076: Path.glob() now raises a ValueError if it'
s
called
with
an
invalid
pattern
.
Patch
by
Thomas
Nyberg
.
-
Issue
#
19883
:
Fixed
possible
integer
overflows
in
zipimport
.
-
Issue
#
26227
:
On
Windows
,
getnameinfo
(),
gethostbyaddr
()
and
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment