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
41518b4a
Kaydet (Commit)
41518b4a
authored
Mar 19, 2013
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#17474 - Remove the various deprecated methods of Request class.
üst
80cbc9e9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
134 deletions
+2
-134
urllib.request.rst
Doc/library/urllib.request.rst
+0
-69
test_urllib2.py
Lib/test/test_urllib2.py
+0
-21
request.py
Lib/urllib/request.py
+0
-44
NEWS
Misc/NEWS
+2
-0
No files found.
Doc/library/urllib.request.rst
Dosyayı görüntüle @
41518b4a
...
...
@@ -488,54 +488,6 @@ request.
URL given in the constructor.
.. method:: Request.add_data(data)
Set the :class:`Request` data to *data*. This is ignored by all handlers except
HTTP handlers --- and there it should be a byte string, and will change the
request to be ``POST`` rather than ``GET``. Deprecated in 3.3, use
:attr:`Request.data`.
.. deprecated:: 3.3
.. method:: Request.has_data()
Return whether the instance has a non-\ ``None`` data. Deprecated in 3.3,
use :attr:`Request.data`.
.. deprecated:: 3.3
.. method:: Request.get_data()
Return the instance's data. Deprecated in 3.3, use :attr:`Request.data`.
.. deprecated:: 3.3
.. method:: Request.get_type()
Return the type of the URL --- also known as the scheme. Deprecated in 3.3,
use :attr:`Request.type`.
.. deprecated:: 3.3
.. method:: Request.get_host()
Return the host to which a connection will be made. Deprecated in 3.3, use
:attr:`Request.host`.
.. deprecated:: 3.3
.. method:: Request.get_selector()
Return the selector --- the part of the URL that is sent to the server.
Deprecated in 3.3, use :attr:`Request.selector`.
.. deprecated:: 3.3
.. method:: Request.get_header(header_name, default=None)
Return the value of the given header. If the header is not present, return
...
...
@@ -546,27 +498,6 @@ request.
Return a list of tuples (header_name, header_value) of the Request headers.
.. method:: Request.set_proxy(host, type)
.. method:: Request.get_origin_req_host()
Return the request-host of the origin transaction, as defined by
:rfc:`2965`. See the documentation for the :class:`Request` constructor.
Deprecated in 3.3, use :attr:`Request.origin_req_host`.
.. deprecated:: 3.3
.. method:: Request.is_unverifiable()
Return whether the request is unverifiable, as defined by RFC 2965. See the
documentation for the :class:`Request` constructor. Deprecated in 3.3, use
:attr:`Request.unverifiable`.
.. deprecated:: 3.3
.. _opener-director-objects:
OpenerDirector Objects
...
...
Lib/test/test_urllib2.py
Dosyayı görüntüle @
41518b4a
...
...
@@ -630,27 +630,6 @@ class OpenerDirectorTests(unittest.TestCase):
self
.
assertTrue
(
args
[
1
]
is
None
or
isinstance
(
args
[
1
],
MockResponse
))
def
test_method_deprecations
(
self
):
req
=
Request
(
"http://www.example.com"
)
with
self
.
assertWarns
(
DeprecationWarning
):
req
.
add_data
(
"data"
)
with
self
.
assertWarns
(
DeprecationWarning
):
req
.
get_data
()
with
self
.
assertWarns
(
DeprecationWarning
):
req
.
has_data
()
with
self
.
assertWarns
(
DeprecationWarning
):
req
.
get_host
()
with
self
.
assertWarns
(
DeprecationWarning
):
req
.
get_selector
()
with
self
.
assertWarns
(
DeprecationWarning
):
req
.
is_unverifiable
()
with
self
.
assertWarns
(
DeprecationWarning
):
req
.
get_origin_req_host
()
with
self
.
assertWarns
(
DeprecationWarning
):
req
.
get_type
()
def
sanepathname2url
(
path
):
try
:
path
.
encode
(
"utf-8"
)
...
...
Lib/urllib/request.py
Dosyayı görüntüle @
41518b4a
...
...
@@ -321,50 +321,6 @@ class Request:
else
:
return
self
.
full_url
# Begin deprecated methods
def
add_data
(
self
,
data
):
msg
=
"Request.add_data method is deprecated."
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
1
)
self
.
data
=
data
def
has_data
(
self
):
msg
=
"Request.has_data method is deprecated."
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
1
)
return
self
.
data
is
not
None
def
get_data
(
self
):
msg
=
"Request.get_data method is deprecated."
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
1
)
return
self
.
data
def
get_type
(
self
):
msg
=
"Request.get_type method is deprecated."
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
1
)
return
self
.
type
def
get_host
(
self
):
msg
=
"Request.get_host method is deprecated."
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
1
)
return
self
.
host
def
get_selector
(
self
):
msg
=
"Request.get_selector method is deprecated."
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
1
)
return
self
.
selector
def
is_unverifiable
(
self
):
msg
=
"Request.is_unverifiable method is deprecated."
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
1
)
return
self
.
unverifiable
def
get_origin_req_host
(
self
):
msg
=
"Request.get_origin_req_host method is deprecated."
warnings
.
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
1
)
return
self
.
origin_req_host
# End deprecated methods
def
set_proxy
(
self
,
host
,
type
):
if
self
.
type
==
'https'
and
not
self
.
_tunnel_host
:
self
.
_tunnel_host
=
self
.
host
...
...
Misc/NEWS
Dosyayı görüntüle @
41518b4a
...
...
@@ -289,6 +289,8 @@ Core and Builtins
Library
-------
- Issue #17474: Remove the deprecated methods of Request class.
- Issue #16709: unittest discover order is no-longer filesystem specific. Patch
by Jeff Ramnani.
...
...
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