Skip to content

gh-80480: remove deprecated 'u' type code (array)#149535

Merged
vstinner merged 7 commits into
python:mainfrom
skirpichev:remove-array-u
Jun 1, 2026
Merged

gh-80480: remove deprecated 'u' type code (array)#149535
vstinner merged 7 commits into
python:mainfrom
skirpichev:remove-array-u

Conversation

@skirpichev
Copy link
Copy Markdown
Member

@skirpichev skirpichev commented May 8, 2026

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 8, 2026

Documentation build overview

📚 cpython-previews | 🛠️ Build #32933925 | 📁 Comparing 37738f4 against main (4ae1a26)

  🔍 Preview build  

77 files changed · + 1 added · ± 76 modified

+ Added

± Modified

Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Please, don't forget to fix docs in Doc/library/array.rst

@skirpichev skirpichev marked this pull request as ready for review May 8, 2026 07:28
@skirpichev skirpichev requested a review from AA-Turner as a code owner May 8, 2026 07:28
@skirpichev skirpichev requested a review from sobolevn May 8, 2026 08:04
Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

LGTM, but I am not a module expert, so let's wait for one to merge this :)

@skirpichev
Copy link
Copy Markdown
Member Author

CC @vstinner

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

I cannot find remaining references to the u format in (updated) array, memoryview and struct: good!

Note: ctypes.c_wchar uses _type_ = "u" but this type code is unrelated to struct type codes. This ctypes is not deprecated.

Comment thread Doc/whatsnew/3.16.rst
Comment thread Lib/test/test_array.py Outdated
Comment thread Lib/test/test_re.py Outdated
Comment thread Modules/arraymodule.c
@skirpichev skirpichev requested a review from vstinner June 1, 2026 11:03
@vstinner
Copy link
Copy Markdown
Member

vstinner commented Jun 1, 2026

Tests / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm) (pull_request)Failing after 1m
Tests / Ubuntu / build and test (ubuntu-24.04-arm) (pull_request)Failing after 1m
Tests / WASI / build and test (pull_request)Failing after 1m

Strange, the 3 jobs failed with Error: The operation was canceled. Canceled by what? I will re-run these jobs once other jobs completed.

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the update.

Reuse array.typecodes makes the code easier to maintain.

@vstinner vstinner enabled auto-merge (squash) June 1, 2026 11:10
@vstinner vstinner merged commit 46b5e3e into python:main Jun 1, 2026
102 of 106 checks passed
@skirpichev skirpichev deleted the remove-array-u branch June 1, 2026 11:58
@vstinner
Copy link
Copy Markdown
Member

vstinner commented Jun 1, 2026

Merged. Thanks for the change.

@bedevere-bot
Copy link
Copy Markdown

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

Hi! The buildbot AMD64 Debian root 3.x (tier-1) has failed when building commit 46b5e3e.

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/345/builds/14390) and take a look at the build logs.
  4. Check if the failure is related to this commit (46b5e3e) 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/345/builds/14390

Failed tests:

  • test_embed

Failed subtests:

  • test_thread_state_ensure - test.test_embed.AuditingTests.test_thread_state_ensure

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_embed.py", line 2036, in test_thread_state_ensure
    self.run_embedded_interpreter("test_thread_state_ensure")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_embed.py", line 161, in run_embedded_interpreter
    self.assertEqual(p.returncode, returncode,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
                     "bad returncode %d, stderr is %r" %
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     (p.returncode, err))
                     ^^^^^^^^^^^^^^^^^^^^
AssertionError: -6 != 0 : bad returncode -6, stderr is "_testembed: ./Programs/_testembed.c:2741: test_thread_state_ensure: Assertion `_Py_atomic_load_int(&data.done) == 1' failed.\n"


Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 948, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed file <_io.FileIO name=13 mode='wb' closefd=True>


Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 948, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed file <_io.FileIO name=11 mode='wb' closefd=True>

@vstinner
Copy link
Copy Markdown
Member

vstinner commented Jun 1, 2026

Hi! The buildbot AMD64 Debian root 3.x (tier-1) has failed when building commit 46b5e3e.
test_thread_state_ensure - test.test_embed.AuditingTests.test_thread_state_ensure

That's the unrelated issue gh-150391.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants