Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-96819: check if the length of a pipe write is not greater than 512#96890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 8 commits intopython:mainfromsaito828koki:fix-issue-96819
Oct 3, 2022

Conversation

saito828koki
Copy link
Contributor

@saito828kokisaito828koki commentedSep 17, 2022
edited by bedevere-bot
Loading

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@@ -161,7 +161,7 @@ def unregister(self, name, rtype):
def _send(self, cmd, name, rtype):
self.ensure_running()
msg = '{0}:{1}:{2}\n'.format(cmd, name, rtype).encode('ascii')
if len(name) > 512:
if len(msg) > 512:
# posix guarantees that writes to a pipe of less than PIPE_BUF
# bytes are atomic, and that PIPE_BUF >= 512
raise ValueError('name too long')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Shouldn't this also be updated? ie.msg too long?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@DanielNoord
Thanks for your comment!
The error message should also be updated. I will fix it.

@@ -0,0 +1 @@
Fixed the block to guarantee that the length of a write to a pipe is not greater than PIPE_BUF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
Fixed theblock to guarantee that the length of a write to a pipe is not greater than PIPE_BUF
Fixed thecheck that guarantees that the length of a write to a pipe is not greater than PIPE_BUF

saito828koki reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for correcting my English! Your suggestion seems to be great.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No worries! I struggle with writing good and short changelog entries myself many times! 😄

saito828koki reacted with laugh emoji
@JelleZijlstra
Copy link
Member

Is it possible to write a unit test for this change?

@saito828koki
Copy link
ContributorAuthor

Hello@JelleZijlstra ,

Thanks for your comment.
I added a test for this change. Could you review this PR?

@@ -0,0 +1 @@
Fixed the check that guarantees that the length of a write to a pipe is not greater than PIPE_BUF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Mentionmultiprocessing.resource_tracker in news.

saito828koki reacted with thumbs up emoji
@kumaraditya303kumaraditya303 added type-bugAn unexpected behavior, bug, or error needs backport to 3.10only security fixes needs backport to 3.11only security fixes labelsOct 1, 2022
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
@miss-islington
Copy link
Contributor

Thanks@saito828koki for the PR, and@JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-97745 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelOct 3, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 3, 2022
…pipe write <= 512 (pythonGH-96890)Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>(cherry picked from commit19ca114)Co-authored-by: Koki Saito <49419225+saito828koki@users.noreply.github.com>
@bedevere-botbedevere-bot removed the needs backport to 3.10only security fixes labelOct 3, 2022
@bedevere-bot
Copy link

GH-97746 is a backport of this pull request to the3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 3, 2022
…pipe write <= 512 (pythonGH-96890)Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>(cherry picked from commit19ca114)Co-authored-by: Koki Saito <49419225+saito828koki@users.noreply.github.com>
miss-islington added a commit that referenced this pull requestOct 3, 2022
…rite <= 512 (GH-96890)Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>(cherry picked from commit19ca114)Co-authored-by: Koki Saito <49419225+saito828koki@users.noreply.github.com>
miss-islington added a commit that referenced this pull requestOct 3, 2022
…rite <= 512 (GH-96890)Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>(cherry picked from commit19ca114)Co-authored-by: Koki Saito <49419225+saito828koki@users.noreply.github.com>
carljm added a commit to carljm/cpython that referenced this pull requestOct 3, 2022
* main: (2069 commits)pythongh-96512: Move int_max_str_digits setting to PyConfig (python#96944)pythongh-94808: Coverage: Check picklablability of calliter (python#95923)pythongh-94808: Add test coverage for PyObject_HasAttrString (python#96627)pythongh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (python#97765)  Fix typos in `bltinmodule.c`. (pythonGH-97766)pythongh-94808: `_PyLineTable_StartsLine` was not used (pythonGH-96609)pythongh-97681: Remove Tools/demo/ directory (python#97682)  Fix typo in unittest docs (python#97742)pythongh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE converter (pythonGH-97729)pythongh-95913: Fix PEP number in PEP 678 What's New ref label (python#97739)pythongh-95913: Copyedit/improve New Modules What's New section (python#97721)pythongh-97740: Fix bang in Sphinx C domain ref target syntax (python#97741)pythongh-96819: multiprocessing.resource_tracker: check if length of pipe write <= 512 (python#96890)pythongh-97706: multiprocessing tests: Delete unused variable `rand` (python#97707)pythonGH-85447: Clarify docs about awaiting future multiple times (python#97738)  [docs] Update logging cookbook with recipe for using a logger like an output… (pythonGH-97730)pythongh-97607: Fix content parsing in the impl-detail reST directive (python#97652)pythongh-95975: Move except/*/finally ref labels to more precise locations (python#95976)pythongh-97591: In `Exception.__setstate__()` acquire strong references before calling `tp_hash` slot (python#97700)pythongh-95588: Drop the safety claim from `ast.literal_eval` docs. (python#95919)  ...
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@DanielNoordDanielNoordDanielNoord approved these changes

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

Assignees
No one assigned
Labels
type-bugAn unexpected behavior, bug, or error
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@saito828koki@bedevere-bot@JelleZijlstra@miss-islington@DanielNoord@kumaraditya303

[8]ページ先頭

©2009-2025 Movatter.jp