Ljzd-PRO / Ljzd-PRO/KToolBox

RuntimeError: There is no current event loop in thread 'MainThread'.

Open
#361 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
579
Forks
26
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug

A clear and concise description of what the bug is.

## Command & Configuration

The command you execute and the configuration you use.

For example:

### Command

```shell
ktoolbox sync-creator https://kemono.su/fanbox/user/9016
```

### Configuration

```dotenv
KTOOLBOX_API__NETLOC=coomer.su
KTOOLBOX_API__FILES_NETLOC=coomer.su
```

## Platform

Please complete the following information

- OS: [e.g. Windows]

- KToolBox Version [e.g. 0.23.0]

**Additional context**
所有下载指令都显示这个
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "C:\Users\Administrator\.local\bin\ktoolbox.exe\__main__.py", line 6, in
File "C:\Users\Administrator\pipx\venvs\ktoolbox\Lib\site-packages\ktoolbox\__main__.py", line 19, in main
fire.Fire(KToolBoxCli)
File "C:\Users\Administrator\pipx\venvs\ktoolbox\Lib\site-packages\fire\core.py", line 135, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\pipx\venvs\ktoolbox\Lib\site-packages\fire\core.py", line 468, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\pipx\venvs\ktoolbox\Lib\site-packages\fire\core.py", line 681, in _CallAndUpdateTrace
loop = asyncio.get_event_loop()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\pipx\venvs\ktoolbox\Lib\site-packages\winloop\__init__.py", line 206, in get_event_loop
raise RuntimeError(
RuntimeError: There is no current event loop in thread 'MainThread'.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ktoolbox __main__.py entry point shown in the traceback and reproduce the sync-creator command on Windows. Investigate the event-loop failure involving Fire and winloop, then verify that the affected download commands complete without raising RuntimeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.