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
c80902ea
Kaydet (Commit)
c80902ea
authored
Haz 18, 2008
tarafından
Amaury Forgeot d'Arc
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
follow-up of r64385: rename urllib.quote in nturl2path
and remove assertions & debugger when ssl is not present
üst
cb0d2d71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
nturl2path.py
Lib/nturl2path.py
+7
-7
request.py
Lib/urllib/request.py
+0
-3
No files found.
Lib/nturl2path.py
Dosyayı görüntüle @
c80902ea
...
@@ -7,7 +7,7 @@ def url2pathname(url):
...
@@ -7,7 +7,7 @@ def url2pathname(url):
# ///C|/foo/bar/spam.foo
# ///C|/foo/bar/spam.foo
# becomes
# becomes
# C:\foo\bar\spam.foo
# C:\foo\bar\spam.foo
import
string
,
urllib
import
string
,
urllib
.
parse
# Windows itself uses ":" even in URLs.
# Windows itself uses ":" even in URLs.
url
=
url
.
replace
(
':'
,
'|'
)
url
=
url
.
replace
(
':'
,
'|'
)
if
not
'|'
in
url
:
if
not
'|'
in
url
:
...
@@ -19,7 +19,7 @@ def url2pathname(url):
...
@@ -19,7 +19,7 @@ def url2pathname(url):
url
=
url
[
2
:]
url
=
url
[
2
:]
components
=
url
.
split
(
'/'
)
components
=
url
.
split
(
'/'
)
# make sure not to convert quoted slashes :-)
# make sure not to convert quoted slashes :-)
return
urllib
.
unquote
(
'
\\
'
.
join
(
components
))
return
urllib
.
parse
.
unquote
(
'
\\
'
.
join
(
components
))
comp
=
url
.
split
(
'|'
)
comp
=
url
.
split
(
'|'
)
if
len
(
comp
)
!=
2
or
comp
[
0
][
-
1
]
not
in
string
.
ascii_letters
:
if
len
(
comp
)
!=
2
or
comp
[
0
][
-
1
]
not
in
string
.
ascii_letters
:
error
=
'Bad URL: '
+
url
error
=
'Bad URL: '
+
url
...
@@ -29,7 +29,7 @@ def url2pathname(url):
...
@@ -29,7 +29,7 @@ def url2pathname(url):
path
=
drive
+
':'
path
=
drive
+
':'
for
comp
in
components
:
for
comp
in
components
:
if
comp
:
if
comp
:
path
=
path
+
'
\\
'
+
urllib
.
unquote
(
comp
)
path
=
path
+
'
\\
'
+
urllib
.
parse
.
unquote
(
comp
)
return
path
return
path
def
pathname2url
(
p
):
def
pathname2url
(
p
):
...
@@ -39,7 +39,7 @@ def pathname2url(p):
...
@@ -39,7 +39,7 @@ def pathname2url(p):
# C:\foo\bar\spam.foo
# C:\foo\bar\spam.foo
# becomes
# becomes
# ///C|/foo/bar/spam.foo
# ///C|/foo/bar/spam.foo
import
urllib
import
urllib
.parse
if
not
':'
in
p
:
if
not
':'
in
p
:
# No drive specifier, just convert slashes and quote the name
# No drive specifier, just convert slashes and quote the name
if
p
[:
2
]
==
'
\\\\
'
:
if
p
[:
2
]
==
'
\\\\
'
:
...
@@ -48,16 +48,16 @@ def pathname2url(p):
...
@@ -48,16 +48,16 @@ def pathname2url(p):
# (notice doubling of slashes at the start of the path)
# (notice doubling of slashes at the start of the path)
p
=
'
\\\\
'
+
p
p
=
'
\\\\
'
+
p
components
=
p
.
split
(
'
\\
'
)
components
=
p
.
split
(
'
\\
'
)
return
urllib
.
quote
(
'/'
.
join
(
components
))
return
urllib
.
parse
.
quote
(
'/'
.
join
(
components
))
comp
=
p
.
split
(
':'
)
comp
=
p
.
split
(
':'
)
if
len
(
comp
)
!=
2
or
len
(
comp
[
0
])
>
1
:
if
len
(
comp
)
!=
2
or
len
(
comp
[
0
])
>
1
:
error
=
'Bad path: '
+
p
error
=
'Bad path: '
+
p
raise
IOError
(
error
)
raise
IOError
(
error
)
drive
=
urllib
.
quote
(
comp
[
0
]
.
upper
())
drive
=
urllib
.
parse
.
quote
(
comp
[
0
]
.
upper
())
components
=
comp
[
1
]
.
split
(
'
\\
'
)
components
=
comp
[
1
]
.
split
(
'
\\
'
)
path
=
'///'
+
drive
+
'|'
path
=
'///'
+
drive
+
'|'
for
comp
in
components
:
for
comp
in
components
:
if
comp
:
if
comp
:
path
=
path
+
'/'
+
urllib
.
quote
(
comp
)
path
=
path
+
'/'
+
urllib
.
parse
.
quote
(
comp
)
return
path
return
path
Lib/urllib/request.py
Dosyayı görüntüle @
c80902ea
...
@@ -105,7 +105,6 @@ except:
...
@@ -105,7 +105,6 @@ except:
_have_ssl
=
False
_have_ssl
=
False
else
:
else
:
_have_ssl
=
True
_have_ssl
=
True
assert
_have_ssl
# used in User-Agent header sent
# used in User-Agent header sent
__version__
=
sys
.
version
[:
3
]
__version__
=
sys
.
version
[:
3
]
...
@@ -417,8 +416,6 @@ def build_opener(*handlers):
...
@@ -417,8 +416,6 @@ def build_opener(*handlers):
FTPHandler
,
FileHandler
,
HTTPErrorProcessor
]
FTPHandler
,
FileHandler
,
HTTPErrorProcessor
]
if
hasattr
(
http
.
client
,
"HTTPSConnection"
):
if
hasattr
(
http
.
client
,
"HTTPSConnection"
):
default_classes
.
append
(
HTTPSHandler
)
default_classes
.
append
(
HTTPSHandler
)
else
:
import
pdb
;
pdb
.
set_trace
()
skip
=
set
()
skip
=
set
()
for
klass
in
default_classes
:
for
klass
in
default_classes
:
for
check
in
handlers
:
for
check
in
handlers
:
...
...
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