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
54ad523f
Kaydet (Commit)
54ad523f
authored
May 27, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make xmlrpclib fail less (test_sundry passes).
üst
859b5ec2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
xmlrpclib.py
Lib/xmlrpclib.py
+7
-18
No files found.
Lib/xmlrpclib.py
Dosyayı görüntüle @
54ad523f
...
@@ -143,11 +143,6 @@ from types import *
...
@@ -143,11 +143,6 @@ from types import *
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# Internal stuff
# Internal stuff
try
:
str
except
NameError
:
str
=
None
# unicode support not available
try
:
try
:
import
datetime
import
datetime
except
ImportError
:
except
ImportError
:
...
@@ -160,7 +155,7 @@ except NameError:
...
@@ -160,7 +155,7 @@ except NameError:
def
_decode
(
data
,
encoding
,
is8bit
=
re
.
compile
(
"[
\x80
-
\xff
]"
)
.
search
):
def
_decode
(
data
,
encoding
,
is8bit
=
re
.
compile
(
"[
\x80
-
\xff
]"
)
.
search
):
# decode non-ascii string (if possible)
# decode non-ascii string (if possible)
if
str
and
encoding
and
is8bit
(
data
):
if
encoding
and
is8bit
(
data
):
data
=
str
(
data
,
encoding
)
data
=
str
(
data
,
encoding
)
return
data
return
data
...
@@ -169,16 +164,12 @@ def escape(s):
...
@@ -169,16 +164,12 @@ def escape(s):
s
=
s
.
replace
(
"<"
,
"<"
)
s
=
s
.
replace
(
"<"
,
"<"
)
return
s
.
replace
(
">"
,
">"
,)
return
s
.
replace
(
">"
,
">"
,)
if
str
:
def
_stringify
(
string
):
def
_stringify
(
string
):
# convert to 7-bit ascii if possible
# convert to 7-bit ascii if possible
try
:
try
:
return
string
.
encode
(
"ascii"
)
return
string
.
encode
(
"ascii"
)
except
UnicodeError
:
except
UnicodeError
:
return
string
return
string
else
:
def
_stringify
(
string
):
return
string
__version__
=
"1.0.1"
__version__
=
"1.0.1"
...
@@ -306,7 +297,7 @@ class DateTime:
...
@@ -306,7 +297,7 @@ class DateTime:
"""
"""
def
__init__
(
self
,
value
=
0
):
def
__init__
(
self
,
value
=
0
):
if
not
isinstance
(
value
,
StringType
):
if
not
isinstance
(
value
,
basestring
):
if
datetime
and
isinstance
(
value
,
datetime
.
datetime
):
if
datetime
and
isinstance
(
value
,
datetime
.
datetime
):
self
.
value
=
value
.
strftime
(
"
%
Y
%
m
%
dT
%
H:
%
M:
%
S"
)
self
.
value
=
value
.
strftime
(
"
%
Y
%
m
%
dT
%
H:
%
M:
%
S"
)
return
return
...
@@ -627,15 +618,14 @@ class Marshaller:
...
@@ -627,15 +618,14 @@ class Marshaller:
write
(
"<value><string>"
)
write
(
"<value><string>"
)
write
(
escape
(
value
))
write
(
escape
(
value
))
write
(
"</string></value>
\n
"
)
write
(
"</string></value>
\n
"
)
dispatch
[
StringType
]
=
dump_string
dispatch
[
str8
]
=
dump_string
if
str
:
def
dump_unicode
(
self
,
value
,
write
,
escape
=
escape
):
def
dump_unicode
(
self
,
value
,
write
,
escape
=
escape
):
value
=
value
.
encode
(
self
.
encoding
)
value
=
value
.
encode
(
self
.
encoding
)
write
(
"<value><string>"
)
write
(
"<value><string>"
)
write
(
escape
(
value
))
write
(
escape
(
value
))
write
(
"</string></value>
\n
"
)
write
(
"</string></value>
\n
"
)
dispatch
[
UnicodeType
]
=
dump_unicode
dispatch
[
str
]
=
dump_unicode
def
dump_array
(
self
,
value
,
write
):
def
dump_array
(
self
,
value
,
write
):
i
=
id
(
value
)
i
=
id
(
value
)
...
@@ -660,8 +650,7 @@ class Marshaller:
...
@@ -660,8 +650,7 @@ class Marshaller:
write
(
"<value><struct>
\n
"
)
write
(
"<value><struct>
\n
"
)
for
k
,
v
in
value
.
items
():
for
k
,
v
in
value
.
items
():
write
(
"<member>
\n
"
)
write
(
"<member>
\n
"
)
if
type
(
k
)
is
not
StringType
:
if
isinstance
(
k
,
basestring
):
if
str
and
type
(
k
)
is
UnicodeType
:
k
=
k
.
encode
(
self
.
encoding
)
k
=
k
.
encode
(
self
.
encoding
)
else
:
else
:
raise
TypeError
,
"dictionary key must be string"
raise
TypeError
,
"dictionary key must be string"
...
@@ -1044,7 +1033,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None,
...
@@ -1044,7 +1033,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None,
# standard XML-RPC wrappings
# standard XML-RPC wrappings
if
methodname
:
if
methodname
:
# a method call
# a method call
if
not
isinstance
(
methodname
,
StringType
):
if
not
isinstance
(
methodname
,
basestring
):
methodname
=
methodname
.
encode
(
encoding
)
methodname
=
methodname
.
encode
(
encoding
)
data
=
(
data
=
(
xmlheader
,
xmlheader
,
...
...
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