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
2d517218
Kaydet (Commit)
2d517218
authored
May 29, 2011
tarafından
Charles-François Natali
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12196: Add PIPE_MAX_SIZE to test.support, constant larger than the
underlying OS pipe buffer size.
üst
b30eed98
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
+13
-9
support.py
Lib/test/support.py
+8
-1
test_io.py
Lib/test/test_io.py
+1
-1
test_subprocess.py
Lib/test/test_subprocess.py
+4
-7
No files found.
Lib/test/support.py
Dosyayı görüntüle @
2d517218
...
@@ -48,7 +48,7 @@ __all__ = [
...
@@ -48,7 +48,7 @@ __all__ = [
"threading_cleanup"
,
"reap_children"
,
"cpython_only"
,
"check_impl_detail"
,
"threading_cleanup"
,
"reap_children"
,
"cpython_only"
,
"check_impl_detail"
,
"get_attribute"
,
"swap_item"
,
"swap_attr"
,
"requires_IEEE_754"
,
"get_attribute"
,
"swap_item"
,
"swap_attr"
,
"requires_IEEE_754"
,
"TestHandler"
,
"Matcher"
,
"can_symlink"
,
"skip_unless_symlink"
,
"TestHandler"
,
"Matcher"
,
"can_symlink"
,
"skip_unless_symlink"
,
"import_fresh_module"
,
"requires_zlib"
"import_fresh_module"
,
"requires_zlib"
,
"PIPE_MAX_SIZE"
]
]
class
Error
(
Exception
):
class
Error
(
Exception
):
...
@@ -409,6 +409,13 @@ def _is_ipv6_enabled():
...
@@ -409,6 +409,13 @@ def _is_ipv6_enabled():
IPV6_ENABLED
=
_is_ipv6_enabled
()
IPV6_ENABLED
=
_is_ipv6_enabled
()
# A constant likely larger than the underlying OS pipe buffer size.
# Windows limit seems to be around 512B, and most Unix kernels have a 64K pipe
# buffer size: take 1M to be sure.
PIPE_MAX_SIZE
=
1024
*
1024
# decorator for skipping tests on non-IEEE 754 platforms
# decorator for skipping tests on non-IEEE 754 platforms
requires_IEEE_754
=
unittest
.
skipUnless
(
requires_IEEE_754
=
unittest
.
skipUnless
(
float
.
__getformat__
(
"double"
)
.
startswith
(
"IEEE"
),
float
.
__getformat__
(
"double"
)
.
startswith
(
"IEEE"
),
...
...
Lib/test/test_io.py
Dosyayı görüntüle @
2d517218
...
@@ -2683,7 +2683,7 @@ class SignalsTest(unittest.TestCase):
...
@@ -2683,7 +2683,7 @@ class SignalsTest(unittest.TestCase):
# The buffered IO layer must check for pending signal
# The buffered IO layer must check for pending signal
# handlers, which in this case will invoke alarm_interrupt().
# handlers, which in this case will invoke alarm_interrupt().
self
.
assertRaises
(
ZeroDivisionError
,
self
.
assertRaises
(
ZeroDivisionError
,
wio
.
write
,
item
*
(
1024
*
1024
))
wio
.
write
,
item
*
(
support
.
PIPE_MAX_SIZE
//
len
(
item
)
))
t
.
join
()
t
.
join
()
# We got one byte, get another one and check that it isn't a
# We got one byte, get another one and check that it isn't a
# repeat of the first one.
# repeat of the first one.
...
...
Lib/test/test_subprocess.py
Dosyayı görüntüle @
2d517218
...
@@ -489,24 +489,21 @@ class ProcessTestCase(BaseTestCase):
...
@@ -489,24 +489,21 @@ class ProcessTestCase(BaseTestCase):
# This test will probably deadlock rather than fail, if
# This test will probably deadlock rather than fail, if
# communicate() does not work properly.
# communicate() does not work properly.
x
,
y
=
os
.
pipe
()
x
,
y
=
os
.
pipe
()
if
mswindows
:
pipe_buf
=
512
else
:
pipe_buf
=
os
.
fpathconf
(
x
,
"PC_PIPE_BUF"
)
os
.
close
(
x
)
os
.
close
(
x
)
os
.
close
(
y
)
os
.
close
(
y
)
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
'import sys,os;'
'import sys,os;'
'sys.stdout.write(sys.stdin.read(47));'
'sys.stdout.write(sys.stdin.read(47));'
'sys.stderr.write("xyz"*
%
d);'
'sys.stderr.write("x" *
%
d);'
'sys.stdout.write(sys.stdin.read())'
%
pipe_buf
],
'sys.stdout.write(sys.stdin.read())'
%
support
.
PIPE_MAX_SIZE
],
stdin
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stderr
=
subprocess
.
PIPE
)
self
.
addCleanup
(
p
.
stdout
.
close
)
self
.
addCleanup
(
p
.
stdout
.
close
)
self
.
addCleanup
(
p
.
stderr
.
close
)
self
.
addCleanup
(
p
.
stderr
.
close
)
self
.
addCleanup
(
p
.
stdin
.
close
)
self
.
addCleanup
(
p
.
stdin
.
close
)
string_to_write
=
b
"a
bc"
*
pipe_buf
string_to_write
=
b
"a
"
*
support
.
PIPE_MAX_SIZE
(
stdout
,
stderr
)
=
p
.
communicate
(
string_to_write
)
(
stdout
,
stderr
)
=
p
.
communicate
(
string_to_write
)
self
.
assertEqual
(
stdout
,
string_to_write
)
self
.
assertEqual
(
stdout
,
string_to_write
)
...
...
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