Replace array 'u' typecode with 'w'
ProprietaryThe '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. ReplaceArrayUnicodeTypecodemod run . --recipe= org. openrewrite. python. migrate. ReplaceArrayUnicodeTypecodeInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.