Skip to content

bpo-36127: Fix _PyArg_UnpackKeywords() warning #12345

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

bpo-36127: Fix _PyArg_UnpackKeywords() warning #12345

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 15, 2019

Use Py_ssize_t type rather than int for the 'i' variable.

https://bugs.python.org/issue36127

Use Py_ssize_t type rather than int for the 'i' variable.
@vstinner
Copy link
Member Author

This change fix the following warning on Windows:

c:\projects\cpython\python\getargs.c(2425): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data [C:\projects\cpython\PCbuild\pythoncore.vcxproj]

@serhiy-storchaka: Would you mind to review this change?

@serhiy-storchaka
Copy link
Member

I do not think this is the best way to fix this warning. All corresponding variables except nargs have type int, and I want to preserve this.

@vstinner
Copy link
Member Author

I do not think this is the best way to fix this warning. All corresponding variables except nargs have type int, and I want to preserve this.

Why is it wrong to use Py_ssize_t for 'i'?

I don't want to use Py_ssize_t for other variables, since _PyParser uses int.

Feel free to fix the warning differently. I only worry of having no compiler warning on Windows :-)

@vstinner
Copy link
Member Author

Serhiy wrote a diffrent fix: PR #12353.

@vstinner vstinner closed this Mar 18, 2019
@vstinner vstinner deleted the getargs_warn branch March 18, 2019 17:39
loic-simon pushed a commit to loic-simon/cpython that referenced this pull request Apr 30, 2025
gpshead added a commit to gpshead/blurb that referenced this pull request Jul 4, 2025
Integrate the user-friendly features from PR python#16 by @picnixz into the
automation support from PR python#45, making the CLI more intuitive:

- Change --gh-issue to --issue, accepting multiple formats:
  * Plain numbers: --issue 12345
  * With gh- prefix: --issue gh-12345
  * GitHub URLs: --issue python/cpython#12345

- Add smart section matching with:
  * Case-insensitive matching: --section lib matches "Library"
  * Partial matching: --section doc matches "Documentation"
  * Common aliases: --section api matches "C API"
  * Separator normalization: --section core-and-builtins

- Improve error messages for invalid sections

This combines the automation features from PR python#45 with the interface
improvements suggested by @picnixz in PR python#16, as reviewed by @hugovk
and @larryhastings.

Co-authored-by: picnixz <[email protected]>
gpshead added a commit to gpshead/blurb that referenced this pull request Jul 4, 2025
Integrate the user-friendly features from PR python#16 by @picnixz into the automation support from PR python#45, making the CLI more intuitive:

- Change --gh-issue to --issue, accepting multiple formats:
  * Plain numbers: --issue 12345
  * With gh- prefix: --issue gh-12345
  * GitHub URLs: --issue python/cpython#12345

- Add smart section matching with:
  * Case-insensitive matching: --section lib matches "Library"
  * Partial matching: --section doc matches "Documentation"
  * Common aliases: --section api matches "C API"
  * Separator normalization: --section core-and-builtins

- Improve error messages for invalid sections

This combines the automation features from PR python#45 with the interface improvements suggested by @picnixz in PR python#16, as reviewed by @hugovk and @larryhastings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants