Replies: 2 comments 2 replies
-
|
feels like a reasonable feature request to me |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Refiled as #2445 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Suppose we have:
code.py:At execution, the following stack trace appears in console:
Those
<exec>patterns instead of file names are not very informative.Of course, when we only have one Python
<script>, it's pretty evident that<exec>meanscode.py.But in a larger project, with workers, it could be difficult to quickly understand which process crashed, and which file to lookup those line numbers in.
As far as I understand Python, those
<exec>things appear because file name was not specified when Python code was compiled.As far as I understand PyScript, is starts Python scripts using
(await loadPyodide(...)).runPythonAsync(), which, as far as I could find, is always called with code only, without any options. But if{filename: './code.py'}is passed to it, it should replace those<exec>strings, and should also be reflected in global__file__variable and insys.modules['__main__'].__file__too.Is it possible to pass
<script>'ssrcattribute asfilenametorunPythonAsync()options?That sounds logical and probably would resolve the problem.
Beta Was this translation helpful? Give feedback.
All reactions