Garulf / FlowYouTube

Search YouTube.com
8 stars 0 forks source link

issue #7

Closed alexpandain closed 2 years ago

alexpandain commented 2 years ago
Flow Launcher version: 1.9.3
OS Version: Microsoft Windows NT 10.0.22000.0
IntPtr Length: 8
x64: True

Python Path: 
Date: 05/26/2022 19:49:34
Exception:
System.IO.InvalidDataException: FlowYouTube|Traceback (most recent call last):
  File "C:\Users\user\scoop\apps\Flow-Launcher\current\app-1.9.3\UserData\Plugins\FlowYouTube-0.4.0\run.py", line 9, in <module>
    from plugin.main import FlowYouTube
  File "C:\Users\user\scoop\apps\Flow-Launcher\current\app-1.9.3\UserData\Plugins\FlowYouTube-0.4.0\plugin\main.py", line 3, in <module>
    from flox import Flox, utils, ICON_BROWSER
  File "C:\Users\user\scoop\apps\Flow-Launcher\current\app-1.9.3\UserData\Plugins\FlowYouTube-0.4.0\lib\flox\__init__.py", line 38, in <module>
    if str(APPDATA.joinpath(launcher_dir)) in str(CURRENT_WORKING_DIR):
  File "C:\Users\user\scoop\apps\python\current\lib\pathlib.py", line 849, in joinpath
    return self._make_child(args)
  File "C:\Users\user\scoop\apps\python\current\lib\pathlib.py", line 614, in _make_child
    drv, root, parts = self._parse_args(args)
  File "C:\Users\user\scoop\apps\python\current\lib\pathlib.py", line 576, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 287
   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 301
   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 321
   at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<<QueryForPluginAsync>b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 192
--- End of stack trace from previous location ---
   at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 40
   at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 191
   at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass137_0.<<QueryResults>g__QueryTask|2>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 613
--- End of stack trace from previous location ---
   at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 587
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Garulf commented 2 years ago

Updated the library which should fix this issue. Please give Version 0.4.2 a try.

This issue was caused by code in the Flox library that was run to detect Flow Launcher's location when in portable mode. Tested and fixed in: https://github.com/Garulf/FlowYouTube/pull/9 You can update in Flow Launcher by typing

pm update FlowYouTube
snide commented 2 years ago

Just a follow up. I've run into something similar as well and can confirm I'm on 0.5.0 and the latest flow launcher.

As a sort of aside what's the best method to work with Python/node in flow launcher if you have WSL2 running? I'd like to help with some small plugins and the docs, and was mostly trying to learn from your plugin examples, but then would hit interesting problems like... oh, hmm, I'm using Node in WSL, but not Windows directly... is there a way to point one to another? Sorry I'm a little newer to Windows dev and your Launcher seemed the best of the bunch.

Flow Launcher version: 1.9.3
OS Version: Microsoft Windows NT 10.0.22000.0
IntPtr Length: 8
x64: True

Python Path: 
Date: 06/02/2022 12:12:41
Exception:
System.IO.InvalidDataException: FlowYouTube|Traceback (most recent call last):
  File "C:\Users\daves\scoop\apps\Flow-Launcher\current\app-1.9.3\UserData\Plugins\FlowYouTube-0.5.0\run.py", line 9, in <module>
    from plugin.main import FlowYouTube
  File "C:\Users\daves\scoop\apps\Flow-Launcher\current\app-1.9.3\UserData\Plugins\FlowYouTube-0.5.0\plugin\main.py", line 3, in <module>
    from flox import Flox, utils, ICON_BROWSER
  File "C:\Users\daves\scoop\apps\Flow-Launcher\current\app-1.9.3\UserData\Plugins\FlowYouTube-0.5.0\lib\flox\__init__.py", line 40, in <module>
    if str(APPDATA.joinpath(launcher_dir)) in str(CURRENT_WORKING_DIR):
  File "pathlib.py", line 930, in joinpath
  File "pathlib.py", line 712, in _make_child
  File "pathlib.py", line 666, in _parse_args
TypeError: expected str, bytes or os.PathLike object, not NoneType

   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 287
   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 301
   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 321
   at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<<QueryForPluginAsync>b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 192
--- End of stack trace from previous location ---
   at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 40
   at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 191
   at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass137_0.<<QueryResults>g__QueryTask|2>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 623
--- End of stack trace from previous location ---
   at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 587
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Garulf commented 2 years ago

Just a follow up. I've run into something similar as well and can confirm I'm on 0.5.0 and the latest flow launcher.

As a sort of aside what's the best method to work with Python/node in flow launcher if you have WSL2 running? I'd like to help with some small plugins and the docs, and was mostly trying to learn from your plugin examples, but then would hit interesting problems like... oh, hmm, I'm using Node in WSL, but not Windows directly... is there a way to point one to another? Sorry I'm a little newer to Windows dev and your Launcher seemed the best of the bunch.

Ah! it is a similar issue but not quite a bug. The library I'm using, Flox assumes it's in a windows environment (Which is a pretty safe bet considering you're running Flow Launcher or Wox) and attempts to find your launchers install location by checking your Environmental variables like %APPDATA% and %LOCALAPPDATA%.

I haven't tested it personally but aftr thinking about it you should be able to "trick" the plugin into working by setting those variables to the proper windows path.

Example:

export APPDATA=/mnt/c/Users/Garulf/AppData/Roaming/FlowLauncher
export LOCALAPPDATA=/mnt/c/Users/Garulf/Local/Roaming/FlowLauncher

P.S. I wasn't 100% sure but are you saying the latest version of FlowYouTube is still not working for you @snide?

snide commented 2 years ago

Thanks for the response. To be clear this is my setup:

Thank for the wonderful app. I'm coming over from a Linux workstation, and Flowlauncher is great drop in replacement for some of my workflows. One I figure out the best way to actually develop (I like using WSL, but it seems like I need to keep runtime deps over in Windows as well) I'll try my hand at getting some plugins going and add them to the registry.

SonaliBendre commented 2 years ago

not working. I updated but the same error appears

Garulf commented 2 years ago

Ah! Sorry I didn't notice but the issue is Scoop. I wasn't aware that scoop used a different folder structure and folder name for Flow Launcher. it's fixed in version 1.0.0 (https://github.com/Garulf/FlowYouTube/pull/11)