If Ryven is run from a python script, AND some node packages are passed as arguments, AND the startup screen is enabled, the startup fails due to some Path/str confusion.
The two node packages are personal packages I am testing. The problem is also present if only 'std' is used, for example.
The error shown is this:
File "C:\Users\pfjar\AppData\Local\Programs\Python\Python311\Lib\site-packages\ryven\gui\startup_dialog\StartupDialog.py", line 647, in update_packages_lists
if pkg_path.stem == node_item.text():
^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'stem'
`
It is clear that the problem arises because the script treats the node packages as Paths, but when Ryven is run from a python script (and maybe from the command line?) the passed packages are only strings, not Paths yet. Now, I dug through the code, and couldn't easily find the place where string paths are converted to Paths, when packages are passed as arguments. Not sure if there is a place? So i have come up with a simple solution that works, but a better one can probably be easily implemented.
Proposed solution:
Include the following lines before each pkg_path.stem call in StartupDialog.py (there are 4):
if isinstance(pkg_path, str):
pkg_path = pathlib.Path(pkg_path)
Hope this helps leon-thomm and anyone having this issue!
Got a simple one here:
If Ryven is run from a python script, AND some node packages are passed as arguments, AND the startup screen is enabled, the startup fails due to some Path/str confusion.
To reproduce, I give you a simple code:
The two node packages are personal packages I am testing. The problem is also present if only 'std' is used, for example.
The error shown is this:
` It is clear that the problem arises because the script treats the node packages as Paths, but when Ryven is run from a python script (and maybe from the command line?) the passed packages are only strings, not Paths yet. Now, I dug through the code, and couldn't easily find the place where string paths are converted to Paths, when packages are passed as arguments. Not sure if there is a place? So i have come up with a simple solution that works, but a better one can probably be easily implemented.
Proposed solution: Include the following lines before each
pkg_path.stem
call in StartupDialog.py (there are 4):Hope this helps leon-thomm and anyone having this issue!