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
1c136f35
Kaydet (Commit)
1c136f35
authored
Mar 18, 2002
tarafından
Michael W. Hudson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
amk's fix attached to
[ 516299 ] urlparse can get fragments wrong
üst
39d2b3c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
test_urlparse
Lib/test/output/test_urlparse
+5
-0
test_urlparse.py
Lib/test/test_urlparse.py
+18
-0
urlparse.py
Lib/urlparse.py
+3
-1
No files found.
Lib/test/output/test_urlparse
Dosyayı görüntüle @
1c136f35
test_urlparse
http://www.python.org = ('http', 'www.python.org', '', '', '', '')
http://www.python.org#abc = ('http', 'www.python.org', '', '', '', 'abc')
http://www.python.org/#abc = ('http', 'www.python.org', '/', '', '', 'abc')
http://a/b/c/d;p?q#f = ('http', 'a', '/b/c/d', 'p', 'q', 'f')
urlparse.urljoin() tests
g:h = 'g:h'
...
...
Lib/test/test_urlparse.py
Dosyayı görüntüle @
1c136f35
...
...
@@ -4,6 +4,24 @@ errors = 0
RFC1808_BASE
=
"http://a/b/c/d;p?q#f"
for
url
,
expected
in
[(
'http://www.python.org'
,
(
'http'
,
'www.python.org'
,
''
,
''
,
''
,
''
)),
(
'http://www.python.org#abc'
,
(
'http'
,
'www.python.org'
,
''
,
''
,
''
,
'abc'
)),
(
'http://www.python.org/#abc'
,
(
'http'
,
'www.python.org'
,
'/'
,
''
,
''
,
'abc'
)),
(
RFC1808_BASE
,
(
'http'
,
'a'
,
'/b/c/d'
,
'p'
,
'q'
,
'f'
)),
]:
result
=
urlparse
.
urlparse
(
url
)
print
"
%-13
s =
%
r"
%
(
url
,
result
)
if
result
!=
expected
:
errors
+=
1
print
"urlparse(
%
r)"
%
url
print
(
"expected
%
r,
\n
"
" got
%
r"
)
%
(
expected
,
result
)
print
def
checkJoin
(
relurl
,
expected
):
global
errors
result
=
urlparse
.
urljoin
(
RFC1808_BASE
,
relurl
)
...
...
Lib/urlparse.py
Dosyayı görüntüle @
1c136f35
...
...
@@ -87,7 +87,9 @@ def urlsplit(url, scheme='', allow_fragments=1):
if
url
[:
2
]
==
'//'
:
i
=
url
.
find
(
'/'
,
2
)
if
i
<
0
:
i
=
len
(
url
)
i
=
url
.
find
(
'#'
)
if
i
<
0
:
i
=
len
(
url
)
netloc
=
url
[
2
:
i
]
url
=
url
[
i
:]
if
allow_fragments
and
'#'
in
url
:
...
...
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