GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.15] gh-158810: Fix Py_ARRAY_LENGTH() macro on C++ by vstinner · Pull Request #159315 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Oct 13, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: [C API] Py_ARRAY_LENGTH() macro is incompatible with g++ -std=gnu++11 #158810

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vstinner added 3 commits October 13, 2026 14:52
@vstinner
pythongh-158810: Fix Py_ARRAY_LENGTH() macro on C++ (python#158812)
e003e68
(cherry picked from commit b2bfbce)
@vstinner
pythongh-158810: Use _Py_TYPEOF in Py_ARRAY_LENGTH() (python#158838)
cb396ff
Fix the compiler warning "extension used" when building test_cext
with clang.

* test_cext no longer overrides the CC environment variable if it's
  already defined.
* test_cext now also logs __STRICT_ANSI__ macro.

(cherry picked from commit 85c03d4)
@vstinner
Add Py_SETREF/XSETREF tests to test_cext
5ecb4b4
@bedevere-app bedevere-app Bot mentioned this pull request Oct 13, 2026
[C API] Py_ARRAY_LENGTH() macro is incompatible with g++ -std=gnu++11 #158810
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 13, 2026
@vstinner vstinner added the needs backport to 3.14 bugs and security fixes label Oct 13, 2026
@vstinner
vstinner enabled auto-merge (squash) October 13, 2026 13:29
@vstinner
vstinner merged commit 152185f into python:3.15 Oct 13, 2026
58 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner deleted the array_len15 branch October 13, 2026 13:32
@miss-islington-app

miss-islington-app Bot commented Oct 13, 2026

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 13, 2026
@miss-islington-app

miss-islington-app Bot commented Oct 13, 2026

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 152185fdf81515df55925e0bebccb9000c34cb11 3.14
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned vstinner Oct 13, 2026
@bedevere-bot

bedevere-bot commented Oct 13, 2026

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86-64 macOS 3.15 (tier-2) has failed when building commit 152185f.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/2031/builds/440) and take a look at the build logs.
  4. Check if the failure is related to this commit (152185f) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/2031/builds/440

Failed tests:

  • test_cext

Failed subtests:

  • test_build - test.test_cext.TestInteralCpp.test_build
  • test_build_cpp03 - test.test_cext.TestPublicCpp.test_build_cpp03
  • test_build_cpp11 - test.test_cext.TestPublicCpp.test_build_cpp11

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 151, in test_build_cpp11
    self.check_build('_test_cppext_cpp11', std='c++11')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 106, in check_build
    run_cmd('Tests', cmd)
    ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 81, in run_cmd
    subprocess.run(cmd, check=True, env=env)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/subprocess.py", line 692, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ['/Users/buildbot/buildarea/3.15.billenstein-macos/build/build/test_python_13579æ/tempcwd/env/bin/python.exe', '-X', 'dev', '/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py', '_test_cppext_cpp11'] returned non-zero exit status 1.


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 192, in test_build
    self.check_build('_test_cppext_internal')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 106, in check_build
    run_cmd('Tests', cmd)
    ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 81, in run_cmd
    subprocess.run(cmd, check=True, env=env)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/subprocess.py", line 692, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ['/Users/buildbot/buildarea/3.15.billenstein-macos/build/build/test_python_13579æ/tempcwd/env/bin/python.exe', '-X', 'dev', '/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py', '_test_cppext_internal'] returned non-zero exit status 1.


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 147, in test_build_cpp03
    self.check_build('_test_cppext_cpp03', std='c++03')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 106, in check_build
    run_cmd('Tests', cmd)
    ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 81, in run_cmd
    subprocess.run(cmd, check=True, env=env)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/subprocess.py", line 692, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ['/Users/buildbot/buildarea/3.15.billenstein-macos/build/build/test_python_13579æ/tempcwd/env/bin/python.exe', '-X', 'dev', '/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py', '_test_cppext_cpp03'] returned non-zero exit status 1.


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 147, in test_build_cpp03
    self.check_build('_test_cppext_cpp03', std='c++03')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 106, in check_build
    run_cmd('Tests', cmd)
    ~~~~~~~^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/__init__.py", line 81, in run_cmd
    subprocess.run(cmd, check=True, env=env)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/subprocess.py", line 692, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ['/Users/buildbot/buildarea/3.15.billenstein-macos/build/build/test_python_14639æ/tempcwd/env/bin/python.exe', '-X', 'dev', '/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py', '_test_cppext_cpp03'] returned non-zero exit status 1.


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py", line 68, in <module>
    main()
    ~~~~^^
  File "/Users/buildbot/buildarea/3.15.billenstein-macos/build/Lib/test/test_cext/runtests.py", line 62, in main
    raise AssertionError(f'Tests leaked {diff} references')
AssertionError: Tests leaked 1 references
ERROR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added a commit that referenced this pull request Oct 13, 2026
@vstinner
[3.14] gh-158810: Fix Py_ARRAY_LENGTH() macro on C++ (#159317)
931322b
* [3.15] gh-158810: Fix Py_ARRAY_LENGTH() macro on C++ (#159315)

* gh-158810: Fix Py_ARRAY_LENGTH() macro on C++ (#158812)

(cherry picked from commit b2bfbce)

* gh-158810: Use _Py_TYPEOF in Py_ARRAY_LENGTH() (#158838)

Fix the compiler warning "extension used" when building test_cext
with clang.

* test_cext no longer overrides the CC environment variable if it's
  already defined.
* test_cext now also logs __STRICT_ANSI__ macro.

(cherry picked from commit 85c03d4)

* Add Py_SETREF/XSETREF tests to test_cext

(cherry picked from commit 152185f)

* Backport Py_CLEAR/Py_SETREF/Py_XSETREF from main
@StanFromIreland StanFromIreland removed the needs backport to 3.14 bugs and security fixes label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@vstinner vstinner

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @bedevere-bot @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.