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
2fc5a508
Kaydet (Commit)
2fc5a508
authored
May 24, 2012
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #14036: return None when port in urlparse cross 65535
üst
346c5de0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
test_urlparse.py
Lib/test/test_urlparse.py
+5
-0
parse.py
Lib/urllib/parse.py
+3
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_urlparse.py
Dosyayı görüntüle @
2fc5a508
...
...
@@ -524,6 +524,11 @@ class UrlParseTestCase(unittest.TestCase):
self
.
assertEqual
(
p
.
port
,
80
)
self
.
assertEqual
(
p
.
geturl
(),
url
)
# Verify an illegal port is returned as None
url
=
b
"HTTP://WWW.PYTHON.ORG:65536/doc/#frag"
p
=
urllib
.
parse
.
urlsplit
(
url
)
self
.
assertEqual
(
p
.
port
,
None
)
def
test_attributes_bad_port
(
self
):
"""Check handling of non-integer ports."""
p
=
urllib
.
parse
.
urlsplit
(
"http://www.example.net:foo"
)
...
...
Lib/urllib/parse.py
Dosyayı görüntüle @
2fc5a508
...
...
@@ -143,6 +143,9 @@ class _NetlocResultMixinBase(object):
port
=
self
.
_hostinfo
[
1
]
if
port
is
not
None
:
port
=
int
(
port
,
10
)
# Return None on an illegal port
if
not
(
0
<=
port
<=
65535
):
return
None
return
port
...
...
Misc/NEWS
Dosyayı görüntüle @
2fc5a508
...
...
@@ -67,6 +67,9 @@ Core and Builtins
Library
-------
- Issue #14036: Add an additional check to validate that port in urlparse does
not go in illegal range and returns None.
- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
- Issue #14426: Correct the Date format in Expires attribute of Set-Cookie
...
...
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