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-87804: Fix error handling and style in_pystatvfs_fromstructstatfs#115236

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
sobolevn merged 1 commit intopython:mainfromsobolevn:issue-87804
Feb 12, 2024

Conversation

@sobolevn
Copy link
Member

@sobolevnsobolevn commentedFeb 10, 2024
edited by bedevere-appbot
Loading

Things I've fixed:

  • A typo
  • There were several indentation issues (3 vs 4 spaces)
  • Errors were potentially swallowed (I know that this is unlikely, but only the last error was reported previously. Now the first one will be)

Copy link
Contributor

@ronaldoussorenronaldoussoren left a comment

Choose a reason for hiding this comment

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

LGTM

PyStructSequence_SET_ITEM(v,7,
PyLong_FromLongLong((long long)st.f_ffree));
PyStructSequence_SET_ITEM(v,8,PyLong_FromLong((long)flags));
#defineSET_ITEM(v,index,item) \
Copy link
Contributor

Choose a reason for hiding this comment

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

@sobolevn, the macro expansion of this will leak memory:item gets substituted asPyLong_FromLong, etc. at every occurrence, i.e.:

    do {        if (PyLong_FromLong((long) st.f_iosize) == NULL) {            Py_DECREF(v);            return NULL;        }        PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long) st.f_iosize));    } while (0)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, looks like you already figured it out 😊

@sobolevn
Copy link
MemberAuthor

Fix:#115335

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull requestFeb 14, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@colesburycolesburycolesbury left review comments

@ronaldoussorenronaldoussorenronaldoussoren approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@sobolevn@colesbury@ronaldoussoren

[8]ページ先頭

©2009-2025 Movatter.jp