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
ddaea1c3
Kaydet (Commit)
ddaea1c3
authored
Nis 15, 2011
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11467: Fix urlparse behavior when handling urls which contains scheme
specific part only digits. Patch by Santoso Wijaya.
üst
1bb18cc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
test_urlparse.py
Lib/test/test_urlparse.py
+5
-2
urlparse.py
Lib/urlparse.py
+9
-5
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_urlparse.py
Dosyayı görüntüle @
ddaea1c3
...
...
@@ -196,10 +196,13 @@ class UrlParseTestCase(unittest.TestCase):
#self.checkJoin(RFC1808_BASE, 'http:g', 'http:g')
#self.checkJoin(RFC1808_BASE, 'http:', 'http:')
def
test_RFC2368
(
self
):
# Issue 11467: path that starts with a number is not parsed correctly
self
.
assertEqual
(
urlparse
.
urlparse
(
'mailto:1337@example.org'
),
(
'mailto'
,
''
,
'1337@example.org'
,
''
,
''
,
''
))
def
test_RFC2396
(
self
):
# cases from RFC 2396
self
.
checkJoin
(
RFC2396_BASE
,
'g:h'
,
'g:h'
)
self
.
checkJoin
(
RFC2396_BASE
,
'g'
,
'http://a/b/c/g'
)
self
.
checkJoin
(
RFC2396_BASE
,
'./g'
,
'http://a/b/c/g'
)
...
...
Lib/urlparse.py
Dosyayı görüntüle @
ddaea1c3
...
...
@@ -187,11 +187,15 @@ def urlsplit(url, scheme='', allow_fragments=True):
v
=
SplitResult
(
scheme
,
netloc
,
url
,
query
,
fragment
)
_parse_cache
[
key
]
=
v
return
v
if
url
.
endswith
(
':'
)
or
not
url
[
i
+
1
]
.
isdigit
():
for
c
in
url
[:
i
]:
if
c
not
in
scheme_chars
:
break
else
:
for
c
in
url
[:
i
]:
if
c
not
in
scheme_chars
:
break
else
:
try
:
# make sure "url" is not actually a port number (in which case
# "scheme" is really part of the path
_testportnum
=
int
(
url
[
i
+
1
:])
except
ValueError
:
scheme
,
url
=
url
[:
i
]
.
lower
(),
url
[
i
+
1
:]
if
url
[:
2
]
==
'//'
:
...
...
Misc/NEWS
Dosyayı görüntüle @
ddaea1c3
...
...
@@ -51,6 +51,9 @@ Core and Builtins
Library
-------
- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
specific part only digits. Patch by Santoso Wijaya.
- Issue #11474: Fix the bug with url2pathname() handling of '
/
C
|/
' on Windows.
Patch by Santoso Wijaya.
...
...
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