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
68915d75
Commit
68915d75
authored
Apr 24, 2013
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #17835: Fix test_io when the default OS pipe buffer size is larger than one million bytes.
parent
7b0baf0d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
Lib/test/test_io.py
Lib/test/test_io.py
+2
-2
Lib/test/test_support.py
Lib/test/test_support.py
+9
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_io.py
View file @
68915d75
...
...
@@ -2880,7 +2880,7 @@ class SignalsTest(unittest.TestCase):
# The buffered IO layer must check for pending signal
# handlers, which in this case will invoke alarm_interrupt().
self
.
assertRaises
(
ZeroDivisionError
,
wio
.
write
,
item
*
(
3
*
1000
*
1000
))
wio
.
write
,
item
*
(
support
.
PIPE_MAX_SIZE
//
len
(
item
)
+
1
))
t
.
join
()
# We got one byte, get another one and check that it isn't a
# repeat of the first one.
...
...
@@ -2978,7 +2978,7 @@ class SignalsTest(unittest.TestCase):
select
=
support
.
import_module
(
"select"
)
# A quantity that exceeds the buffer size of an anonymous pipe's
# write end.
N
=
1024
*
1024
N
=
support
.
PIPE_MAX_SIZE
r
,
w
=
os
.
pipe
()
fdopen_kwargs
[
"closefd"
]
=
False
# We need a separate thread to read from the pipe and allow the
...
...
Lib/test/test_support.py
View file @
68915d75
...
...
@@ -400,6 +400,15 @@ def fcmp(x, y): # fuzzy comparison function
return
(
len
(
x
)
>
len
(
y
))
-
(
len
(
x
)
<
len
(
y
))
return
(
x
>
y
)
-
(
x
<
y
)
# A constant likely larger than the underlying OS pipe buffer size, to
# make writes blocking.
# Windows limit seems to be around 512 B, and many Unix kernels have a
# 64 KiB pipe buffer size or 16 * PAGE_SIZE: take a few megs to be sure.
# (see issue #17835 for a discussion of this number).
PIPE_MAX_SIZE
=
4
*
1024
*
1024
+
1
try
:
unicode
have_unicode
=
True
...
...
Misc/NEWS
View file @
68915d75
...
...
@@ -131,6 +131,9 @@ IDLE
Tests
-----
- Issue #17835: Fix test_io when the default OS pipe buffer size is larger
than one million bytes.
- Issue #17531: Fix tests that thought group and user ids were always the int
type. Also, always allow -1 as a valid group and user id.
...
...
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