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
21603c96
Kaydet (Commit)
21603c96
authored
Agu 05, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge heads
üst
4eda9372
636130ed
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
24 deletions
+33
-24
ipaddress.rst
Doc/library/ipaddress.rst
+0
-0
os.rst
Doc/library/os.rst
+3
-3
3.3.rst
Doc/whatsnew/3.3.rst
+0
-0
gzip.py
Lib/gzip.py
+4
-2
ipaddress.py
Lib/ipaddress.py
+0
-0
test_httpservers.py
Lib/test/test_httpservers.py
+7
-5
test_ipaddress.py
Lib/test/test_ipaddress.py
+13
-12
NEWS
Misc/NEWS
+6
-2
No files found.
Doc/library/ipaddress.rst
Dosyayı görüntüle @
21603c96
This diff is collapsed.
Click to expand it.
Doc/library/os.rst
Dosyayı görüntüle @
21603c96
...
...
@@ -2248,7 +2248,7 @@ features:
dirs.remove('CVS') # don't visit CVS directories
In the next example, walking the tree bottom-up is essential:
:func:`
unlinkat
` doesn't allow deleting a directory before the directory is
:func:`
rmdir
` doesn't allow deleting a directory before the directory is
empty::
# Delete everything reachable from the directory named in "top",
...
...
@@ -2258,9 +2258,9 @@ features:
import os
for root, dirs, files, rootfd in os.fwalk(top, topdown=False):
for name in files:
os.unlink
at(rootfd, name
)
os.unlink
(name, dir_fd=rootfd
)
for name in dirs:
os.
unlinkat(rootfd, name, os.AT_REMOVEDIR
)
os.
rmdir(name, dir_fd=rootfd
)
Availability: Unix.
...
...
Doc/whatsnew/3.3.rst
Dosyayı görüntüle @
21603c96
This diff is collapsed.
Click to expand it.
Lib/gzip.py
Dosyayı görüntüle @
21603c96
...
...
@@ -413,8 +413,10 @@ class GzipFile(io.BufferedIOBase):
if
self
.
fileobj
is
None
:
return
b
''
try
:
# 1024 is the same buffering heuristic used in read()
self
.
_read
(
max
(
n
,
1024
))
# Ensure that we don't return b"" if we haven't reached EOF.
while
self
.
extrasize
==
0
:
# 1024 is the same buffering heuristic used in read()
self
.
_read
(
max
(
n
,
1024
))
except
EOFError
:
pass
offset
=
self
.
offset
-
self
.
extrastart
...
...
Lib/ipaddress.py
Dosyayı görüntüle @
21603c96
This diff is collapsed.
Click to expand it.
Lib/test/test_httpservers.py
Dosyayı görüntüle @
21603c96
...
...
@@ -313,6 +313,8 @@ class CGIHTTPServerTestCase(BaseTestCase):
class
request_handler
(
NoLogRequestHandler
,
CGIHTTPRequestHandler
):
pass
linesep
=
os
.
linesep
.
encode
(
'ascii'
)
def
setUp
(
self
):
BaseTestCase
.
setUp
(
self
)
self
.
cwd
=
os
.
getcwd
()
...
...
@@ -410,7 +412,7 @@ class CGIHTTPServerTestCase(BaseTestCase):
def
test_headers_and_content
(
self
):
res
=
self
.
request
(
'/cgi-bin/file1.py'
)
self
.
assertEqual
((
b
'Hello World
\n
'
,
'text/html'
,
200
),
self
.
assertEqual
((
b
'Hello World
'
+
self
.
linesep
,
'text/html'
,
200
),
(
res
.
read
(),
res
.
getheader
(
'Content-type'
),
res
.
status
))
def
test_post
(
self
):
...
...
@@ -419,7 +421,7 @@ class CGIHTTPServerTestCase(BaseTestCase):
headers
=
{
'Content-type'
:
'application/x-www-form-urlencoded'
}
res
=
self
.
request
(
'/cgi-bin/file2.py'
,
'POST'
,
params
,
headers
)
self
.
assertEqual
(
res
.
read
(),
b
'1, python, 123456
\n
'
)
self
.
assertEqual
(
res
.
read
(),
b
'1, python, 123456
'
+
self
.
linesep
)
def
test_invaliduri
(
self
):
res
=
self
.
request
(
'/cgi-bin/invalid'
)
...
...
@@ -430,20 +432,20 @@ class CGIHTTPServerTestCase(BaseTestCase):
headers
=
{
b
'Authorization'
:
b
'Basic '
+
base64
.
b64encode
(
b
'username:pass'
)}
res
=
self
.
request
(
'/cgi-bin/file1.py'
,
'GET'
,
headers
=
headers
)
self
.
assertEqual
((
b
'Hello World
\n
'
,
'text/html'
,
200
),
self
.
assertEqual
((
b
'Hello World
'
+
self
.
linesep
,
'text/html'
,
200
),
(
res
.
read
(),
res
.
getheader
(
'Content-type'
),
res
.
status
))
def
test_no_leading_slash
(
self
):
# http://bugs.python.org/issue2254
res
=
self
.
request
(
'cgi-bin/file1.py'
)
self
.
assertEqual
((
b
'Hello World
\n
'
,
'text/html'
,
200
),
self
.
assertEqual
((
b
'Hello World
'
+
self
.
linesep
,
'text/html'
,
200
),
(
res
.
read
(),
res
.
getheader
(
'Content-type'
),
res
.
status
))
def
test_os_environ_is_not_altered
(
self
):
signature
=
"Test CGI Server"
os
.
environ
[
'SERVER_SOFTWARE'
]
=
signature
res
=
self
.
request
(
'/cgi-bin/file1.py'
)
self
.
assertEqual
((
b
'Hello World
\n
'
,
'text/html'
,
200
),
self
.
assertEqual
((
b
'Hello World
'
+
self
.
linesep
,
'text/html'
,
200
),
(
res
.
read
(),
res
.
getheader
(
'Content-type'
),
res
.
status
))
self
.
assertEqual
(
os
.
environ
[
'SERVER_SOFTWARE'
],
signature
)
...
...
Lib/test/test_ipaddress.py
Dosyayı görüntüle @
21603c96
...
...
@@ -7,6 +7,7 @@
import
unittest
import
re
import
contextlib
import
operator
import
ipaddress
class
BaseTestCase
(
unittest
.
TestCase
):
...
...
@@ -72,6 +73,14 @@ class CommonTestMixin:
with
self
.
assertAddressError
(
re
.
escape
(
repr
(
"1.0"
))):
self
.
factory
(
1.0
)
def
test_not_an_index_issue15559
(
self
):
# Implementing __index__ makes for a very nasty interaction with the
# bytes constructor. Thus, we disallow implicit use as an integer
self
.
assertRaises
(
TypeError
,
operator
.
index
,
self
.
factory
(
1
))
self
.
assertRaises
(
TypeError
,
hex
,
self
.
factory
(
1
))
self
.
assertRaises
(
TypeError
,
bytes
,
self
.
factory
(
1
))
class
CommonTestMixin_v4
(
CommonTestMixin
):
def
test_leading_zeros
(
self
):
...
...
@@ -599,7 +608,6 @@ class IpaddrUnitTest(unittest.TestCase):
self
.
assertEqual
(
first
,
last
)
self
.
assertEqual
(
128
,
ipaddress
.
_count_righthand_zero_bits
(
0
,
128
))
self
.
assertEqual
(
"IPv4Network('1.2.3.0/24')"
,
repr
(
self
.
ipv4_network
))
self
.
assertEqual
(
'0x1020318'
,
hex
(
self
.
ipv4_network
))
def
testMissingAddressVersion
(
self
):
class
Broken
(
ipaddress
.
_BaseAddress
):
...
...
@@ -639,8 +647,8 @@ class IpaddrUnitTest(unittest.TestCase):
ipv4
=
ipaddress
.
ip_network
(
'1.2.3.4'
)
ipv6
=
ipaddress
.
ip_network
(
'2001:658:22a:cafe:200:0:0:1'
)
self
.
assertEqual
(
ipv4
,
ipaddress
.
ip_network
(
int
(
ipv4
)))
self
.
assertEqual
(
ipv6
,
ipaddress
.
ip_network
(
int
(
ipv6
)))
self
.
assertEqual
(
ipv4
,
ipaddress
.
ip_network
(
int
(
ipv4
.
network_address
)))
self
.
assertEqual
(
ipv6
,
ipaddress
.
ip_network
(
int
(
ipv6
.
network_address
)))
v6_int
=
42540616829182469433547762482097946625
self
.
assertEqual
(
self
.
ipv6_interface
.
_ip
,
...
...
@@ -723,8 +731,8 @@ class IpaddrUnitTest(unittest.TestCase):
'2001:658:22a:cafe:ffff:ffff:ffff:ffff'
)
def
testGetPrefixlen
(
self
):
self
.
assertEqual
(
self
.
ipv4_interface
.
prefixlen
,
24
)
self
.
assertEqual
(
self
.
ipv6_interface
.
prefixlen
,
64
)
self
.
assertEqual
(
self
.
ipv4_interface
.
network
.
prefixlen
,
24
)
self
.
assertEqual
(
self
.
ipv6_interface
.
network
.
prefixlen
,
64
)
def
testGetSupernet
(
self
):
self
.
assertEqual
(
self
.
ipv4_network
.
supernet
()
.
prefixlen
,
23
)
...
...
@@ -1545,13 +1553,6 @@ class IpaddrUnitTest(unittest.TestCase):
self
.
assertEqual
(
42540616829182469433547762482097946625
,
int
(
self
.
ipv6_address
))
def
testHexRepresentation
(
self
):
self
.
assertEqual
(
hex
(
0x1020304
),
hex
(
self
.
ipv4_address
))
self
.
assertEqual
(
hex
(
0x20010658022ACAFE0200000000000001
),
hex
(
self
.
ipv6_address
))
def
testForceVersion
(
self
):
self
.
assertEqual
(
ipaddress
.
ip_network
(
1
)
.
version
,
4
)
self
.
assertEqual
(
ipaddress
.
IPv6Network
(
1
)
.
version
,
6
)
...
...
Misc/NEWS
Dosyayı görüntüle @
21603c96
...
...
@@ -77,8 +77,12 @@ Core and Builtins
Library
-------
-
Issue
#
15546
:
Fix
handling
of
pathological
input
data
in
the
read1
()
method
of
the
BZ2File
,
GzipFile
and
LZMAFile
classes
.
-
Issue
#
15559
:
To
avoid
a
problematic
failure
mode
when
passed
to
the
bytes
constructor
,
objects
in
the
ipaddress
module
no
longer
implement
__index__
(
they
still
implement
__int__
as
appropriate
)
-
Issue
#
15546
:
Fix
handling
of
pathological
input
data
in
the
peek
()
and
read1
()
methods
of
the
BZ2File
,
GzipFile
and
LZMAFile
classes
.
-
Issue
#
13052
:
Fix
IDLE
crashing
when
replace
string
in
Search
/
Replace
dialog
ended
with
'\'
.
Patch
by
Roger
Serwy
.
...
...
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