Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c7513d06
Commit
c7513d06
authored
May 12, 2003
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace normalization.
parent
6cef2212
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
25 deletions
+24
-25
Lib/httplib.py
Lib/httplib.py
+1
-1
Lib/test/test_bool.py
Lib/test/test_bool.py
+0
-1
Lib/test/test_socket.py
Lib/test/test_socket.py
+3
-3
Lib/test/test_types.py
Lib/test/test_types.py
+4
-4
Lib/test/test_urllib.py
Lib/test/test_urllib.py
+10
-10
Lib/textwrap.py
Lib/textwrap.py
+1
-1
Lib/xmlrpclib.py
Lib/xmlrpclib.py
+5
-5
No files found.
Lib/httplib.py
View file @
c7513d06
...
@@ -768,7 +768,7 @@ class HTTPConnection:
...
@@ -768,7 +768,7 @@ class HTTPConnection:
if
self
.
debuglevel
>
0
:
if
self
.
debuglevel
>
0
:
response
=
self
.
response_class
(
self
.
sock
,
self
.
debuglevel
,
response
=
self
.
response_class
(
self
.
sock
,
self
.
debuglevel
,
strict
=
self
.
strict
,
strict
=
self
.
strict
,
method
=
self
.
_method
)
method
=
self
.
_method
)
else
:
else
:
response
=
self
.
response_class
(
self
.
sock
,
strict
=
self
.
strict
,
response
=
self
.
response_class
(
self
.
sock
,
strict
=
self
.
strict
,
...
...
Lib/test/test_bool.py
View file @
c7513d06
...
@@ -325,4 +325,3 @@ def test_main():
...
@@ -325,4 +325,3 @@ def test_main():
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_main
()
test_main
()
Lib/test/test_socket.py
View file @
c7513d06
...
@@ -332,7 +332,7 @@ class GeneralModuleTests(unittest.TestCase):
...
@@ -332,7 +332,7 @@ class GeneralModuleTests(unittest.TestCase):
self
.
assertEquals
(
'
\
x00
\
x00
\
x00
\
x00
'
,
g
(
'0.0.0.0'
))
self
.
assertEquals
(
'
\
x00
\
x00
\
x00
\
x00
'
,
g
(
'0.0.0.0'
))
self
.
assertEquals
(
'
\
xff
\
x00
\
xff
\
x00
'
,
g
(
'255.0.255.0'
))
self
.
assertEquals
(
'
\
xff
\
x00
\
xff
\
x00
'
,
g
(
'255.0.255.0'
))
self
.
assertEquals
(
'
\
xaa
\
xaa
\
xaa
\
xaa
'
,
g
(
'170.170.170.170'
))
self
.
assertEquals
(
'
\
xaa
\
xaa
\
xaa
\
xaa
'
,
g
(
'170.170.170.170'
))
def
testIPv6toString
(
self
):
def
testIPv6toString
(
self
):
if
not
hasattr
(
socket
,
'inet_pton'
):
if
not
hasattr
(
socket
,
'inet_pton'
):
return
# No inet_pton() on this platform
return
# No inet_pton() on this platform
...
@@ -351,7 +351,7 @@ class GeneralModuleTests(unittest.TestCase):
...
@@ -351,7 +351,7 @@ class GeneralModuleTests(unittest.TestCase):
'
\
x45
\
xef
\
x76
\
xcb
\
x00
\
x1a
\
x56
\
xef
\
xaf
\
xeb
\
x0b
\
xac
\
x19
\
x24
\
xae
\
xae
'
,
'
\
x45
\
xef
\
x76
\
xcb
\
x00
\
x1a
\
x56
\
xef
\
xaf
\
xeb
\
x0b
\
xac
\
x19
\
x24
\
xae
\
xae
'
,
f
(
'45ef:76cb:1a:56ef:afeb:bac:1924:aeae'
)
f
(
'45ef:76cb:1a:56ef:afeb:bac:1924:aeae'
)
)
)
def
testStringToIPv4
(
self
):
def
testStringToIPv4
(
self
):
if
not
hasattr
(
socket
,
'inet_ntop'
):
if
not
hasattr
(
socket
,
'inet_ntop'
):
return
# No inet_ntop() on this platform
return
# No inet_ntop() on this platform
...
@@ -362,7 +362,7 @@ class GeneralModuleTests(unittest.TestCase):
...
@@ -362,7 +362,7 @@ class GeneralModuleTests(unittest.TestCase):
self
.
assertEquals
(
'170.85.170.85'
,
f
(
'
\
xaa
\
x55
\
xaa
\
x55
'
))
self
.
assertEquals
(
'170.85.170.85'
,
f
(
'
\
xaa
\
x55
\
xaa
\
x55
'
))
self
.
assertEquals
(
'255.255.255.255'
,
f
(
'
\
xff
\
xff
\
xff
\
xff
'
))
self
.
assertEquals
(
'255.255.255.255'
,
f
(
'
\
xff
\
xff
\
xff
\
xff
'
))
self
.
assertEquals
(
'1.2.3.4'
,
f
(
'
\
x01
\
x02
\
x03
\
x04
'
))
self
.
assertEquals
(
'1.2.3.4'
,
f
(
'
\
x01
\
x02
\
x03
\
x04
'
))
self
.
assertEquals
(
'1.0.1.0'
,
g
(
'
\
x01
\
x00
\
x01
\
x00
'
))
self
.
assertEquals
(
'1.0.1.0'
,
g
(
'
\
x01
\
x00
\
x01
\
x00
'
))
self
.
assertEquals
(
'170.85.170.85'
,
g
(
'
\
xaa
\
x55
\
xaa
\
x55
'
))
self
.
assertEquals
(
'170.85.170.85'
,
g
(
'
\
xaa
\
x55
\
xaa
\
x55
'
))
self
.
assertEquals
(
'255.255.255.255'
,
g
(
'
\
xff
\
xff
\
xff
\
xff
'
))
self
.
assertEquals
(
'255.255.255.255'
,
g
(
'
\
xff
\
xff
\
xff
\
xff
'
))
...
...
Lib/test/test_types.py
View file @
c7513d06
...
@@ -258,8 +258,8 @@ vereq(list(tuple(f())), range(1000))
...
@@ -258,8 +258,8 @@ vereq(list(tuple(f())), range(1000))
# Verify that __getitem__ overrides are not recognized by __iter__
# Verify that __getitem__ overrides are not recognized by __iter__
class
T
(
tuple
):
class
T
(
tuple
):
def
__getitem__
(
self
,
key
):
def
__getitem__
(
self
,
key
):
return
str
(
key
)
+
'!!!'
return
str
(
key
)
+
'!!!'
vereq
(
iter
(
T
((
1
,
2
))).
next
(),
1
)
vereq
(
iter
(
T
((
1
,
2
))).
next
(),
1
)
print
'6.5.3 Lists'
print
'6.5.3 Lists'
...
@@ -455,8 +455,8 @@ vereq(a, [0, 1, 1, 3, 2, 5, 3, 7, 4, 9])
...
@@ -455,8 +455,8 @@ vereq(a, [0, 1, 1, 3, 2, 5, 3, 7, 4, 9])
# Verify that __getitem__ overrides are not recognized by __iter__
# Verify that __getitem__ overrides are not recognized by __iter__
class
L
(
list
):
class
L
(
list
):
def
__getitem__
(
self
,
key
):
def
__getitem__
(
self
,
key
):
return
str
(
key
)
+
'!!!'
return
str
(
key
)
+
'!!!'
vereq
(
iter
(
L
([
1
,
2
])).
next
(),
1
)
vereq
(
iter
(
L
([
1
,
2
])).
next
(),
1
)
...
...
Lib/test/test_urllib.py
View file @
c7513d06
...
@@ -139,14 +139,14 @@ class urlretrieve_FileTests(unittest.TestCase):
...
@@ -139,14 +139,14 @@ class urlretrieve_FileTests(unittest.TestCase):
class
QuotingTests
(
unittest
.
TestCase
):
class
QuotingTests
(
unittest
.
TestCase
):
"""Tests for urllib.quote() and urllib.quote_plus()
"""Tests for urllib.quote() and urllib.quote_plus()
According to RFC 2396 ("Uniform Resource Identifiers), to escape a
According to RFC 2396 ("Uniform Resource Identifiers), to escape a
character you write it as '%' + <2 character US-ASCII hex value>. The Python
character you write it as '%' + <2 character US-ASCII hex value>. The Python
code of ``'%' + hex(ord(<character>))[2:]`` escapes a character properly.
code of ``'%' + hex(ord(<character>))[2:]`` escapes a character properly.
Case does not matter on the hex letters.
Case does not matter on the hex letters.
The various character sets specified are:
The various character sets specified are:
Reserved characters : ";/?:@&=+$,"
Reserved characters : ";/?:@&=+$,"
Have special meaning in URIs and must be escaped if not being used for
Have special meaning in URIs and must be escaped if not being used for
their special meaning
their special meaning
...
@@ -160,7 +160,7 @@ class QuotingTests(unittest.TestCase):
...
@@ -160,7 +160,7 @@ class QuotingTests(unittest.TestCase):
Must be escaped
Must be escaped
Unwise : "{}|
\
^[]`
"
Unwise : "{}|
\
^[]`
"
Must be escaped
Must be escaped
"""
"""
def
test_never_quote
(
self
):
def
test_never_quote
(
self
):
...
@@ -206,7 +206,7 @@ class QuotingTests(unittest.TestCase):
...
@@ -206,7 +206,7 @@ class QuotingTests(unittest.TestCase):
result = urllib.quote_plus(char)
result = urllib.quote_plus(char)
self.assertEqual(hexescape(char), result,
self.assertEqual(hexescape(char), result,
"using quote_plus(): "
"using quote_plus(): "
"%s should be escapes to %s, not %s" %
"%s should be escapes to %s, not %s" %
(char, hexescape(char), result))
(char, hexescape(char), result))
del should_quote
del should_quote
partial_quote = "ab[]cd"
partial_quote = "ab[]cd"
...
@@ -238,7 +238,7 @@ class QuotingTests(unittest.TestCase):
...
@@ -238,7 +238,7 @@ class QuotingTests(unittest.TestCase):
class UnquotingTests(unittest.TestCase):
class UnquotingTests(unittest.TestCase):
"""Tests for unquote() and unquote_plus()
"""Tests for unquote() and unquote_plus()
See the doc string for quoting_Tests for details on quoting and such.
See the doc string for quoting_Tests for details on quoting and such.
"""
"""
...
@@ -279,7 +279,7 @@ class UnquotingTests(unittest.TestCase):
...
@@ -279,7 +279,7 @@ class UnquotingTests(unittest.TestCase):
result = urllib.unquote_plus(given)
result = urllib.unquote_plus(given)
self.assertEqual(expect, result,
self.assertEqual(expect, result,
"using unquote_plus(): %s != %s" % (expect, result))
"using unquote_plus(): %s != %s" % (expect, result))
def test_unquoting_plus(self):
def test_unquoting_plus(self):
# Test difference between unquote() and unquote_plus()
# Test difference between unquote() and unquote_plus()
given = "are+there+spaces..."
given = "are+there+spaces..."
...
@@ -297,15 +297,15 @@ class urlencode_Tests(unittest.TestCase):
...
@@ -297,15 +297,15 @@ class urlencode_Tests(unittest.TestCase):
def help_inputtype(self, given, test_type):
def help_inputtype(self, given, test_type):
"""Helper method for testing different input types.
"""Helper method for testing different input types.
'
given
' must lead to only the pairs:
'
given
' must lead to only the pairs:
* 1st, 1
* 1st, 1
* 2nd, 2
* 2nd, 2
* 3rd, 3
* 3rd, 3
Test cannot assume anything about order. Docs make no guarantee and
Test cannot assume anything about order. Docs make no guarantee and
have possible dictionary input.
have possible dictionary input.
"""
"""
expect_somewhere = ["1st=1", "2nd=2", "3rd=3"]
expect_somewhere = ["1st=1", "2nd=2", "3rd=3"]
result = urllib.urlencode(given)
result = urllib.urlencode(given)
...
@@ -404,7 +404,7 @@ class Pathname_Tests(unittest.TestCase):
...
@@ -404,7 +404,7 @@ class Pathname_Tests(unittest.TestCase):
self.assertEqual(expect, result,
self.assertEqual(expect, result,
"url2pathname() failed; %s != %s" %
"url2pathname() failed; %s != %s" %
(expect, result))
(expect, result))
def test_main():
def test_main():
...
...
Lib/textwrap.py
View file @
c7513d06
...
@@ -318,7 +318,7 @@ def dedent(text):
...
@@ -318,7 +318,7 @@ def dedent(text):
This can be used e.g. to make triple-quoted strings line up with
This can be used e.g. to make triple-quoted strings line up with
the left edge of screen/whatever, while still presenting it in the
the left edge of screen/whatever, while still presenting it in the
source code in indented form.
source code in indented form.
For example:
For example:
...
...
Lib/xmlrpclib.py
View file @
c7513d06
...
@@ -571,7 +571,7 @@ class Marshaller:
...
@@ -571,7 +571,7 @@ class Marshaller:
self
.
data
=
None
self
.
data
=
None
self
.
encoding
=
encoding
self
.
encoding
=
encoding
self
.
allow_none
=
allow_none
self
.
allow_none
=
allow_none
dispatch
=
{}
dispatch
=
{}
def
dumps
(
self
,
values
):
def
dumps
(
self
,
values
):
...
@@ -612,7 +612,7 @@ class Marshaller:
...
@@ -612,7 +612,7 @@ class Marshaller:
raise
TypeError
,
"cannot marshal None unless allow_none is enabled"
raise
TypeError
,
"cannot marshal None unless allow_none is enabled"
write
(
"<value><nil/></value>"
)
write
(
"<value><nil/></value>"
)
dispatch
[
NoneType
]
=
dump_nil
dispatch
[
NoneType
]
=
dump_nil
def
dump_int
(
self
,
value
,
write
):
def
dump_int
(
self
,
value
,
write
):
# in case ints are > 32 bits
# in case ints are > 32 bits
if
value
>
MAXINT
or
value
<
MININT
:
if
value
>
MAXINT
or
value
<
MININT
:
...
@@ -784,7 +784,7 @@ class Unmarshaller:
...
@@ -784,7 +784,7 @@ class Unmarshaller:
self
.
append
(
None
)
self
.
append
(
None
)
self
.
_value
=
0
self
.
_value
=
0
dispatch
[
"nil"
]
=
end_nil
dispatch
[
"nil"
]
=
end_nil
def
end_boolean
(
self
,
data
):
def
end_boolean
(
self
,
data
):
if
data
==
"0"
:
if
data
==
"0"
:
self
.
append
(
False
)
self
.
append
(
False
)
...
@@ -1294,7 +1294,7 @@ class ServerProxy:
...
@@ -1294,7 +1294,7 @@ class ServerProxy:
self
.
__encoding
=
encoding
self
.
__encoding
=
encoding
self
.
__verbose
=
verbose
self
.
__verbose
=
verbose
self
.
__allow_none
=
allow_none
self
.
__allow_none
=
allow_none
def
__request
(
self
,
methodname
,
params
):
def
__request
(
self
,
methodname
,
params
):
# call a method on the remote server
# call a method on the remote server
...
@@ -1340,7 +1340,7 @@ if __name__ == "__main__":
...
@@ -1340,7 +1340,7 @@ if __name__ == "__main__":
# simple test program (from the XML-RPC specification)
# simple test program (from the XML-RPC specification)
# server = ServerProxy("http://localhost:8000") # local server
# server = ServerProxy("http://localhost:8000") # local server
server
=
ServerProxy
(
"http://betty.userland.com"
)
server
=
ServerProxy
(
"http://betty.userland.com"
)
print
server
print
server
...
...
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