IronLanguages / IronLanguages/ironpython3
[Android] PlatformNotSupportedException when importing non-builtin modules
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 316
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 1
Description
Prerequisites
The issue tracker is used to report bugs and request new features, NOT to ask questions.
Questions should be posted in Discussions or to the users mailing list which can be accessed at
https://ironpython.groups.io/g/users.
- [✓] Are you running the latest version?
- [✓] Are you reporting to the correct repository?
- [✓] Did you perform a cursory search?
Description
PlatformNotSupportedException prevents any module from being imported.
Steps to Reproduce
- Target Android .Net 6 (MAUI)
var aPythonEngine = Python.CreateEngine();aPythonEngine.Execute("import foobar");
Expected behavior: No error if "foobar" is in the search path and valid; "No module named 'foobar'" if it does not exist
Actual behavior: Throwing System.PlatformNotSupportedException: Operation is not supported on this platform. at IronPython.Modules.PythonNT.stat(String path, IDictionary2 kwargs) at ...
Workaround: Hooking OperatingSystem.IsOSPlatform(string) and let it return true when the argument is "Linux", then the issue magically disappears.
Everything else seem to work fine with android (As long as you redirected your stdin).
Versions
3.4.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the import of foobar in an Android .NET 6 MAUI target and trace the PythonNT.stat call shown in the exception. Done means valid modules on the search path import successfully, while missing modules produce No module named 'foobar' instead of PlatformNotSupportedException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp, python
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100