Replace array 'u' typecode with 'w'

Proprietary

The 'u' typecode of array.array was deprecated in Python 3.13 and is scheduled for removal in Python 3.16. Replace it with 'w', available since Python 3.13, where the array is only used as text: read with tounicode(), tolist() or len(), indexed, iterated, tested with in, or edited character by character. An array stored in a local that is passed on, returned, printed, sliced or read as bytes is left unchanged, since its typecode and repr differ, and on Windows its item size and bytes. On Windows 'u' also held a character outside the Basic Multilingual Plane as two surrogates, where 'w' holds it as one.

org.openrewrite.python.migrate.ReplaceArrayUnicodeTypecode
mod run . --recipe=org.openrewrite.python.migrate.ReplaceArrayUnicodeTypecode

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.