Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-116622: Complete Android documentation#124259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
8015ef42e08c090f8c9da879c80598d72162c6ec2935384ab023598c9803d40a5190e5e24116399e4c12eabbf457fd73d133efbf0File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .. include for modules that don't work on WASM or mobile platforms | ||
| .. availability:: not Android, not iOS, not WASI. | ||
| This module is not supported on :ref:`mobile platforms <mobile-availability>` | ||
| or :ref:`WebAssembly platforms <wasm-availability>`. |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -19,8 +19,6 @@ slow-but-simple implementation in module :mod:`dbm.dumb` will be used. There | ||||
| is a `third party interface <https://www.jcea.es/programacion/pybsddb.htm>`_ to | ||||
| the Oracle Berkeley DB. | ||||
| .. include:: ../includes/wasm-ios-notavail.rst | ||||
| .. exception:: error | ||||
| A tuple containing the exceptions that can be raised by each of the supported | ||||
| @@ -164,6 +162,8 @@ SQLite backend for the :mod:`dbm` module. | ||||
| The files created by :mod:`dbm.sqlite3` can thus be opened by :mod:`sqlite3`, | ||||
| or any other SQLite browser, including the SQLite CLI. | ||||
| .. include:: ../includes/wasm-notavail.rst | ||||
| .. function:: open(filename, /, flag="r", mode=0o666) | ||||
| Open an SQLite database. | ||||
| @@ -207,6 +207,8 @@ functionality like crash tolerance. | ||||
| The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are incompatible | ||||
| and can not be used interchangeably. | ||||
| .. include:: ../includes/wasm-mobile-notavail.rst | ||||
Comment on lines +210 to +211 Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested change
| ||||
| .. exception:: error | ||||
| Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:`KeyError` is | ||||
| @@ -326,6 +328,8 @@ This module can be used with the "classic" NDBM interface or the | ||||
| when storing values larger than this limit. Reading such corrupted files can | ||||
| result in a hard crash (segmentation fault). | ||||
| .. include:: ../includes/wasm-mobile-notavail.rst | ||||
Comment on lines +331 to +332 Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested change
| ||||
| .. exception:: error | ||||
| Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:`KeyError` is raised | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -58,7 +58,7 @@ Notes on availability | ||
| operating system. | ||
| * If not separately noted, all functions that claim "Availability: Unix" are | ||
| supported on macOSand iOS, both of which build on a Unix core. | ||
| supported on macOS, iOS and Android, all of which build on a Unix core. | ||
| * If an availability note contains both a minimum Kernel version and a minimum | ||
| libc version, then both conditions must hold. For example a feature with note | ||
| @@ -120,43 +120,57 @@ DOM APIs as well as limited networking capabilities with JavaScript's | ||
| .. _Pyodide: https://pyodide.org/ | ||
| .. _PyScript: https://pyscript.net/ | ||
| .. _mobile-availability: | ||
mhsmith marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| .. _iOS-availability: | ||
| iOS | ||
| --- | ||
| Mobile platforms | ||
| ---------------- | ||
| iOS is, in most respects, a POSIX operating system. File I/O, socket handling, | ||
| Android and iOS are, in most respects, POSIX operating systems. File I/O, socket handling, | ||
| and threading all behave as they would on any POSIX operating system. However, | ||
| there are several major differences between iOS and other POSIX systems. | ||
| * iOS can only use Python in "embedded" mode. There is no Python REPL, and no | ||
| ability to execute binaries that are part of the normal Python developer | ||
| experience, such as :program:`pip`. To add Python code to your iOS app, you must use | ||
| the :ref:`Python embedding API <embedding>` to add a Python interpreter to an | ||
| iOS app created with Xcode. See the :ref:`iOS usage guide <using-ios>` for | ||
| more details. | ||
| * An iOS app cannot use any form of subprocessing, background processing, or | ||
| inter-process communication. If an iOS app attempts to create a subprocess, | ||
| the process creating the subprocess will either lock up, or crash. An iOS app | ||
| has no visibility of other applications that are running, nor any ability to | ||
| communicate with other running applications, outside of the iOS-specific APIs | ||
| that exist for this purpose. | ||
| * iOS apps have limited access to modify system resources (such as the system | ||
| there are several major differences: | ||
| * Mobile platforms can only use Python in "embedded" mode. There is no Python | ||
| REPL, and no ability to use separate executables such as :program:`python` or | ||
| :program:`pip`. To add Python code to your mobile app, you must use | ||
| the :ref:`Python embedding API <embedding>`. For more details, see | ||
| :ref:`using-android` and :ref:`using-ios`. | ||
| * Subprocesses: | ||
| * On Android, creating subprocesses is possible but `officially unsupported | ||
| <https://issuetracker.google.com/issues/128554619#comment4>`__. | ||
| In particular, Android does not support any part of the System V IPC API, | ||
| so :mod:`multiprocessing` is not available. | ||
| * An iOS app cannot use any form of subprocessing, multiprocessing, or | ||
| inter-process communication. If an iOS app attempts to create a subprocess, | ||
| the process creating the subprocess will either lock up, or crash. An iOS app | ||
| has no visibility of other applications that are running, nor any ability to | ||
| communicate with other running applications, outside of the iOS-specific APIs | ||
| that exist for this purpose. | ||
AA-Turner marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| * Mobile apps have limited access to modify system resources (such as the system | ||
| clock). These resources will often be *readable*, but attempts to modify | ||
| those resources will usually fail. | ||
| * iOS apps have a limited concept of console input and output. ``stdout`` and | ||
| ``stderr`` *exist*, and content written to ``stdout`` and ``stderr`` will be | ||
| visible in logs when running in Xcode, but this content *won't* be recorded | ||
| in the system log. If a user who has installed your app provides their app | ||
| logs as a diagnostic aid, they will not include any detail written to | ||
| ``stdout`` or ``stderr``. | ||
| * Console input and output: | ||
| * On Android, the native ``stdout`` and ``stderr`` are not connected to | ||
| anything, so Python installs its own streams which redirect messages to the | ||
| system log. These can be seen under the tags ``python.stdout`` and | ||
| ``python.stderr`` respectively. | ||
| * iOS apps have a limited concept of console output. ``stdout`` and | ||
| ``stderr`` *exist*, and content written to ``stdout`` and ``stderr`` will be | ||
| visible in logs when running in Xcode, but this content *won't* be recorded | ||
| in the system log. If a user who has installed your app provides their app | ||
| logs as a diagnostic aid, they will not include any detail written to | ||
| ``stdout`` or ``stderr``. | ||
| iOS apps have no concept of ``stdin`` at all. While iOS apps can have a | ||
| keyboard, this is a software feature, not something that is attached to | ||
| ``stdin``. | ||
| * Mobile apps have no usable ``stdin`` at all. While apps can display an on-screen | ||
| keyboard, this is a software feature, not something that is attached to | ||
| ``stdin``. | ||
| As a result, Python library that involve console manipulation (such as | ||
| :mod:`curses` and :mod:`readline`) are not available on iOS. | ||
| As a result, Python modules that involve console manipulation (such as | ||
| :mod:`curses` and :mod:`readline`) are not available on mobile platforms. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.