GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-95672 skip fcntl when pipesize is smaller than pagesize by hyeongyun0916 · Pull Request #102163 · python/cpython Conversation
|
| pipesize_default = fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) | ||
| pipesize = pipesize_default // 2 # A new value to detect change. | ||
| if pipesize < 512: # the POSIX minimum | ||
| minimum_pipe_size = os.sysconf('SC_PAGESIZE') # There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please follow PEP8: https://peps.python.org/pep-0008/#maximum-line-length
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| os.close(test_pipe_w) | ||
| pipesize = pipesize_default // 2 | ||
| if pipesize < 512: # the POSIX minimum | ||
| minimum_pipe_size = os.sysconf('SC_PAGESIZE') # There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
ditto
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| pipesize_default = fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) | ||
| pipesize = pipesize_default // 2 # A new value to detect change. | ||
| if pipesize < 512: # the POSIX minimum | ||
| minimum_pipe_size = os.sysconf('SC_PAGESIZE') # There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86. |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86.
You need to describe why the os.sysconf('SC_PAGESIZE') is needed rather than describe the issue itself.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| hasattr(fcntl, "F_SETPIPE_SZ") and hasattr(fcntl, "F_GETPIPE_SZ"), | ||
| "F_SETPIPE_SZ and F_GETPIPE_SZ are not available on all platforms.") | ||
| def test_fcntl_f_pipesize(self): | ||
| resource = import_module('resource') |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why not just using import resource?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oh that's right, I'll fix it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| import struct | ||
| import sys | ||
| import unittest | ||
| import resource |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@hyeongyun0916 resource module looks like not available on Windows platform.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'll add a function to the test support.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| interval = minimum_interval | ||
| return sys.setswitchinterval(interval) | ||
|
|
||
| def get_pagesize(): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'll change https://github.com/python/cpython/blob/main/Lib/test/memory_watchdog.py#L13 to get_pagesize in other pr.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| import sys | ||
| import unittest | ||
| from test import support | ||
| from test.support import verbose, cpython_only |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| from test.support import verbose, cpython_only | |
| from test.support import verbose, cpython_only, get_pagesize |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| import struct | ||
| import sys | ||
| import unittest | ||
| from test import support |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| from test import support |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Dong-hee Na <[email protected]>
Co-authored-by: Dong-hee Na <[email protected]>
Co-authored-by: Dong-hee Na <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Thanks for the hardwork!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.