Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now generally available.

google.appengine.api.appinfo.EnsureAsciiString

Ensure s contains only ASCII-safe characters; return it as bytes-type.

s the string or bytes to check.
err the error to raise if not good.

err if it's not ASCII-safe.

s as a string. In python2, string as byte. In python3m string as unicode.