Skip to content
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

simple example failed in Thonny IDE #58

Open
rwblues opened this issue Mar 29, 2024 · 1 comment
Open

simple example failed in Thonny IDE #58

rwblues opened this issue Mar 29, 2024 · 1 comment
Assignees

Comments

@rwblues
Copy link

rwblues commented Mar 29, 2024

  • Fast Dash version:
  • Python version:
  • Operating System:

Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

What I Did

installing is ok. But the example:
from fast_dash import fastdash

@fastdash
def text_to_text_function(input_text):
return input_text

* Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)

does not run. It was executed in the Thonny-IDE and gave the following errors:

%Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "", line 4, in
File "C:\Users\rwbdev\AppData\Roaming\Python\Python310\site-packages\fast_dash\fast_dash.py", line 539, in fastdash
return decorator_fastdash(_callback_fn)
File "C:\Users\rwbdev\AppData\Roaming\Python\Python310\site-packages\fast_dash\fast_dash.py", line 508, in decorator_fastdash
return wrapper_fastdash(
File "C:\Users\rwbdev\AppData\Roaming\Python\Python310\site-packages\fast_dash\fast_dash.py", line 504, in wrapper_fastdash
app = FastDash(callback_fn=callback_fn, **kwargs)
File "C:\Users\rwbdev\AppData\Roaming\Python\Python310\site-packages\fast_dash\fast_dash.py", line 140, in init
self.output_labels = _infer_variable_names(callback_fn)
File "C:\Users\rwbdev\AppData\Roaming\Python\Python310\site-packages\fast_dash\utils.py", line 421, in _infer_variable_names
s = inspect.getsource(func)
File "C:\Users\rwbdev\AppData\Local\Programs\Thonny\lib\inspect.py", line 1139, in getsource
lines, lnum = getsourcelines(object)
File "C:\Users\rwbdev\AppData\Local\Programs\Thonny\lib\inspect.py", line 1121, in getsourcelines
lines, lnum = findsource(object)
File "C:\Users\rwbdev\AppData\Local\Programs\Thonny\lib\inspect.py", line 958, in findsource
raise OSError('could not get source code')
OSError: could not get source code

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
dkedar7 added a commit that referenced this issue Feb 17, 2025
…of inspect. Use dill.source instead. Related to: #58
@dkedar7 dkedar7 self-assigned this Feb 17, 2025
@dkedar7
Copy link
Owner

dkedar7 commented Feb 17, 2025

@rwblues This issue was due to ìnpsect's behavior on terminals. I replaced it with dill.source` and confirmed it works. Thanks for reporting. Try upgrading to v0.2.10 and see if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants