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
56f1e2d8
Kaydet (Commit)
56f1e2d8
authored
Nis 14, 2011
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge from 3.1
üst
c1f0577b
2d2ea1b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
nturl2path.py
Lib/nturl2path.py
+4
-1
test_urllib.py
Lib/test/test_urllib.py
+18
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/nturl2path.py
Dosyayı görüntüle @
56f1e2d8
...
...
@@ -27,9 +27,12 @@ def url2pathname(url):
drive
=
comp
[
0
][
-
1
]
.
upper
()
components
=
comp
[
1
]
.
split
(
'/'
)
path
=
drive
+
':'
for
comp
in
components
:
for
comp
in
components
:
if
comp
:
path
=
path
+
'
\\
'
+
urllib
.
parse
.
unquote
(
comp
)
# Issue #11474 - handing url such as |c/|
if
path
.
endswith
(
':'
)
and
url
.
endswith
(
'/'
):
path
+=
'
\\
'
return
path
def
pathname2url
(
p
):
...
...
Lib/test/test_urllib.py
Dosyayı görüntüle @
56f1e2d8
...
...
@@ -9,6 +9,7 @@ import io
import
unittest
from
test
import
support
import
os
import
sys
import
tempfile
def
hexescape
(
char
):
...
...
@@ -1021,6 +1022,23 @@ class Pathname_Tests(unittest.TestCase):
"url2pathname() failed;
%
s !=
%
s"
%
(
expect
,
result
))
@unittest.skipUnless
(
sys
.
platform
==
'win32'
,
'test specific to the urllib.url2path function.'
)
def
test_ntpath
(
self
):
given
=
(
'/C:/'
,
'///C:/'
,
'/C|//'
)
expect
=
'C:
\\
'
for
url
in
given
:
result
=
urllib
.
request
.
url2pathname
(
url
)
self
.
assertEqual
(
expect
,
result
,
'urllib.request..url2pathname() failed;
%
s !=
%
s'
%
(
expect
,
result
))
given
=
'///C|/path'
expect
=
'C:
\\
path'
result
=
urllib
.
request
.
url2pathname
(
given
)
self
.
assertEqual
(
expect
,
result
,
'urllib.request.url2pathname() failed;
%
s !=
%
s'
%
(
expect
,
result
))
class
Utility_Tests
(
unittest
.
TestCase
):
"""Testcase to test the various utility functions in the urllib."""
...
...
Misc/NEWS
Dosyayı görüntüle @
56f1e2d8
...
...
@@ -53,6 +53,9 @@ Core and Builtins
Library
-------
-
Issue
#
11474
:
Fix
the
bug
with
url2pathname
()
handling
of
'/C|/'
on
Windows
.
Patch
by
Santoso
Wijaya
.
-
Issue
#
9233
:
Fix
json
.
loads
(
'{}'
)
to
return
a
dict
(
instead
of
a
list
),
when
_json
is
not
available
.
...
...
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