I started playing with FlowLauncher today and found your library, and could not understand what's wrong. So after some experiments I found out that it's crashing when using version 0.20.0 and not crashing with any older version (0.19.6 included).
from flox import Flox
# have your class inherit from Flox
class YourClass(Flox):
def query(self, query):
for _ in range(250):
self.add_item(
title=self.args,
subtitle=str(_)
)
if __name__ == "__main__":
YourClass()
Flow Launcher version: 1.0.0
OS Version: 22621.2070
IntPtr Length: 8
x64: True
Python Path: C:\Users\ktos\AppData\Local\Programs\Python\Python310\pythonw.exe
Node Path:
Date: 08/09/2023 18:33:06
Exception:
YourClass Exception:
Websites: https://github.com/ktos/flowgpt
Author: ktos
Version: 0.1.0
Flow.Launcher.Core.ExternalPlugins.FlowPluginException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ContinueDeserialize[TValue](ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack, JsonTypeInfo jsonTypeInfo)
at System.Text.Json.JsonSerializer.ReadFromStreamAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.DeserializedResultAsync(Stream output) in E:\proj2\Flow.Launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 95
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.DeserializedResultAsync(Stream output) in E:\proj2\Flow.Launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 95
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in E:\proj2\Flow.Launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 313
at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<<QueryForPluginAsync>b__0>d.MoveNext() in E:\proj2\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 194
--- End of stack trace from previous location ---
at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in E:\proj2\Flow.Launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 40
at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in E:\proj2\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 216
--- End of inner exception stack trace ---
at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in E:\proj2\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 216
at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass139_0.<<QueryResults>g__QueryTask|2>d.MoveNext() in E:\proj2\Flow.Launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 849
--- End of stack trace from previous location ---
at Flow.Launcher.ViewModel.MainViewModel.QueryResults(Boolean isReQuery) in E:\proj2\Flow.Launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 850
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_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)